WordPress® URL Rewrites for Windows IIS – How to Remove index.php Using HTTPD.ini file
WordPress® can be run on a Windows server and runs well. The only issue is the PESKY PESKY index.php that appears in the URL path.
If you have Helicon’s ISAPI Rewrite installed (which you should if you are running a Windows server) with the HTTPD.ini file, then simply add in this code to the httpd.ini file:
#Rewrite wpcontent path (stylesheet, images, admin)
RewriteRule /blog/wp-(.*) /blog/wp-$1 [I,L]
#Removes index.php
RewriteRule /blog/(.*)$ /blog/index.php/$1 [I,L]
Pretty easy. The first line of code allows all your CSS, images, and admin to work. The second line of code removes the index.php. It works and that is all the is needed to get rid of /index.php in the file path.
Two notes:
1. Our permalink path in WordPress® is /%postname/. Just change that to whatever you need.
2. Our blog directory is called /blog/. Just change that to whatever you need.
3. If the above does not work for you, try this line of code too: RewriteRule /blog/(.*)$ /blog/index.php\?/$1 [I,L]
What you should do next . . .
Join our newsletter, where you will learn educational info on latest insights, tips and best practices.
Share:
About Us
Did you know more than 200 clients have worked with PaperStreet for more than 10 years?
Get a Free Website
Analysis and Consultation
Marketing Services