Forum Topic: .htaccess changes for WP Permalinks
I’m working on updating some old WordPress sites and noticed that the .htaccess codes for permalinks have changed.. will the old permalink rules continue to work if not updated right away?
1 Reply to “.htaccess changes for WP Permalinks”
Yes, the old WP permalink rules should continue to work fine. As discussed at DigWP.com, the new rules have been optimized but the functionality hasn’t changed. For the record, here are the old permalink rules (WP installed in root):
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
..and here are the new and improved permalink rules:
# 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
You can see they’re almost identical, with the additional RewriteRule
serving to prevent direct access to the root index.php
file.