WordPress Permalinks on Windows IIS
WordPress is written in PHP, and generally php runs better under apache on Linux, but you can run it on IIS on Windows machines. In fact this blog is running under Windows.*
If you find you have changed the permalinks options in your wordpress installation, but you find they don’t work, first check if you are running on a Windows machine. On a shared hosting account, it should have said whether it was windows or linux, but at the least, if you have the option for asp.net, then you are on windows.
If you are on a Linux machine under apache, there are loads of resources for making sure permalink rewrites work. Running WordPress on windows however is much less common, so I thought I would post a quick fix for getting it to run under IIS7.
The trick involves adding a web.config file to your base installation. A web.config file is a configuration file used by Windows specifically for .net, but in this case if you are running wordpress you can trick IIS into passing the buck on files it can’t find to WordPress, that then handles it.
Simply ensure the URL Rewrite module is enabled on the IIS server (lots of hosts, including GoDaddy, have this enabled, but talk to your hosting company if it doesn’t), then add the following web.config file to the base of your WordPress installation.
Note – windows prevents downloading anything with .config by default at the end, so download this file, remove the .txt at the end, then upload.
Good luck, and post comments if you still have problems!

thanx for your writing to post, I like your web site and good lucky. Regards.
Thanks for posting this, I was new to the whole Web.config thing running my first Windows server. This was a big help!!!
I am often looking for brandnew posts in the net about this issue. Thx!
GRRRR… I’ve uploaded this file into the server under wordpress, but it still doesn’t work… my permalink still has the 404 error… can someone advice?
Thanks! This worked brilliantly. Every time I enabled permalinks, WordPress was creating a blank web.config file which would cause 500 errors until I deleted it again. No longer!
Ed
Error occurs RE:
web.config.txt
Save Target As:
The system cannot find the file specified
file:///C:/web.config.txt
Could you publish the text of the file on this page please?
You can use the HTML tags around the text and the server will treat the text similar to a comment, ie, it won’t attempt
to execute it. Some servers use the [code][/code] tags to do the same thing. Thank you.
The pre – end pre html tags i wrote in the above reply do not display, so they may work or not for the response. Wish I could edit my reply. Hint Hint.
This worked for me.
Excellent!
Thank you for the post!!!
no this is not working for me. still showing 404 error.
This seems to work if WordPress is installed in the root folder of the website. But I have mine in a sub folder. (All permissions are fine.) But I still get the 404 error.
I tried changing the line:
to
but that doesn’t work.
I also tried putting the web.config file in the root of the website and also in the wp folder. Tried different changes to the above line, but nothing works.
Any advice when running WordPress from a sub folder on IIS7 and Windows 2008 server??
Thanks,
Gary
If the rewrite module is not enabled by the host and they are unwilling to do so does anyone know of a hack that will get round this?
THANK YOU.
Took me most of the day to get pretty URLs running.
THANK YOU.
Regards
Jan
Yay! Worked for me – many thanks.
This worked like a charm.. Thank you! I added some stuff tho!
FYI,
If you open up a new xml file in Dreamweaver and save the below as web.config and them drop it in your root wordpress install this will help with your upload file sizes too..
———————————————————————————————-
add this code to your file..
http://www.codingbeaver.com/myblog/index.php/2010/09/17/the-request-filtering-module-is-configured-to-deny-a-request-that-exceeds-the-request-content-length/
Here’s the updated file i used.. The file will say web.. but it’s web.config.. you just can see it. don’t change it.
http://www.filedump.net/index.php?pic=web1320983378.zip
working link
http://www.filedump.net/dumped/web1320983378.zip
compra dominio…
[...]Wordpress Permalinks on Windows IIS | Global Artwork[...]…
Hi,
I recently transferred a wordpress site from Apache server to IIS. Friendly Urls (custom permalinks are not working). Everytime I update permalinks to custom wordpress tries to write to .htaccess file and displays a code that I should add to .htaccess file since it is not writeable.
When I click on a link on the site it says: The system cannot find the file specified.
The permalinks work if I use one of the preset layouts, but that would mean having index.php in the link structure which is not what I want.
Could someone please assist me on this matter, any insight will be greatly appreciated.
Many thanks
Holy crow you saved my bacon! Thanks!
For moving a WP site from an apach DEV server to an IIS live server (not my idea), this totally fixed my issue!
Thank you so much! Christ, the documentation on this point is so poor elsewhere.
Thanks!
I’m also having problems getting this to work with WordPress installed in a subfolder – does anybody have any suggestions? Many thanks!
Works perfectly.. web.config.txt didn’t worked for me.. so I created web.config and upload to my shared host server. it works.. !! Thanks a lot..