Trouble with permalinks and .htaccess
-
If I change my blog’s permalink URL structure, shouldn’t I see a change in the .htaccess file? I’m not seeing it.
The old URL structure:
https://www.domain.com/blog/year/month/postname/.The newly modified permalink URL structure:
https://www.domain.com/blog/postname/.404’s are coming when external links use the old structure. The .htaccess is supposed to take care of this, right?
I have this in .htaccess:
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress
But it’s not working. I’m getting 404’s from external links that have the old structure.
I noticed at the bottom of WP admin settings>permalinks page there was a message saying “If your .htaccess file were writable, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your .htaccess file.”
So I manually copied the rules to .htaccess. Still no joy. Then I fixed the .htaccess permissions. The WP admin message went away, which means WP is now able to write to .htaccess, right?
Then, realizing WP is installed in a subdirectory – https://www.domain.com/blog/ – I wondered if the .htaccess should be as follows:
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /blog/ RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /blog/index.php [L] </IfModule> # END WordPress
I entered that manually in .htaccess and it made no difference. Same 404’s.
Finally, hoping to see if WP was even writing to the .htaccess, I changed the custom permalink structure to:
https://www.domain.com/WTF/postname/ in WP admin. No changes showed up in .htaccess.I’m out of ideas. I’d like to at least establish why WP doesn’t seem to be writing to .htaccess. My host is Pair.com. I’m pretty sure they allow Apache mod_rewrite.
- The topic ‘Trouble with permalinks and .htaccess’ is closed to new replies.