On the AskApacheRewriteRules options page, did you make sure that using_index_permalinks
is set to false
and that using_mod_rewrite_permalinks
is set to true
? If this isn't the case, WordPress will attempt to use PATH_INFO
for your permalinks, resulting in /index.php/(permalink_structure)
.
Note that the WordPress rewrite class stores its rewrite rules as a WordPress option in the database, which is where AskApacheRewriteRules gets its information. The plugin also apparently formats the rules with the mod_rewrite_rules
function before echoing them to the page, which will surround them with:
<IfModule mod_rewrite.c>
...
</IfModule>
So, the likely reason you can't find the .htaccess
file is because it doesn't exist; the rules are just present in the database. The reason why the rules are present in the database is because you're using permalinks, and this is the auto-generated WordPress ruleset, which is saved regardless of whether it's actually being used or not.
Edit: You must have a .htaccess
file in the root of your web directory with the following contents:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
<IfModule !mod_rewrite.c>
# If mod_rewrite isn't available, we'll do this a hackish (and bad) way...
ErrorDocument 404 /index.php
</IfModule>
The rewrite_rules
option is stored at SELECT option_value FROM wp_options WHERE option_name = 'rewrite_rules'
, but it gets regenerated every time you change the permalink, and isn't used except for writing to .htaccess
from what I can tell.
Anyway, those are definitely the correct rules for what you want to do. Are you sure that mod_rewrite
is enabled on your host?
Edit:
Let's make 100% sure that mod_rewrite
is working correctly and go from there.
Create a .htaccess
file in your web root with the following rules, exactly as written:
RewriteEngine On
RewriteRule ^rwtest http://stackoverflow.com/ [R,L]
Then go to your site with the URL example.com/rwtest
and see if you get redirected to StackOverflow. If not, something is wrong with mod_rewrite
. If you do, then at least we know that piece isn't the problem.