IIS 6.0 Rewrite rules for Wordpress (Forward slash not working and other things)
- by DigitalBlade
Hi, I am using Wordpress 3.0.4 on IIS 6.0 and Windows Server 2003, hosted by a company. I was having lots of issues using permalinks. I have fixed most, but now I have an issue with a forward-slash not being added to the address. This would be fine on most websites, but not on IIS for some reason. Specifically, if I go to "mysite.com/wp-admin" I can log-in and get to the dashboard, but as soon as I click anything there i am redirected to a broken link. For example: "mysite.com/post-new.php". If I add the slash at the end it's fine.
So I tried to have a rewrite rule to automatically add the slash to such address:
RewriteRule /wp-admin /wp-admin/ [L]
But it still doesn't work.
For your reference, here's the complete file:
[ISAPI_Rewrite]
RewriteBase /
RewriteCond ${REQUEST_FILENAME} !-f
RewriteCond ${REQUEST_FILENAME} !-d
# For special WordPress folders (e.g. theme, admin, etc.)
RewriteRule /wp-admin /wp-admin/ [L]
RewriteRule /wp-(.*) /wp-$1 [L]
RewriteRule /(.*\.(?:jpg|jpeg|gif|css|txt|xml|html|png|js)) /$1 [I,L]
# Rules to ensure that normal content gets through
RewriteRule /images/(.*) /images/$1 [L]
RewriteRule /favicon.ico /favicon.ico [L]
RewriteRule /robots.txt /robots.txt [L]
RewriteRule /phpmyadmin/(.*) /phpmyadmin/$1 [L]
RewriteRule /phpmyadmin /phpmyadmin/ [L]
# For all WordPress pages
RewriteRule ^/$ /index.php [L]
RewriteRule /(.*) /index.php/$1 [L]
Any ideas? Thanks in advance