If you install WordPress on IIS you will notice your friendly URLs do not work. This is because WordPress wants to use an apache add-on called “mod_rewrite.” The quick rundown of that this does is it will take your friendly browser URL and actually change them to index.php on the back end. One problem with this method is that IIS does not load apache mods. Here is an easy and free way around this:
- On your IIS Server download and install ISAPI_Rewrite Lite. This filter does the job of mod_rewrite for IIS. When downloading make sure to use the free Lite version. This Lite version does not limit the product very much and will be perfectly fine (and free) for our wordpress blog. Just install Rewrite Lite to the default locations for this tutorial.
- Next add the ISAPI filter to your IIS Site.
You will find this setting by right clicking yourIIS site -> properties -> ISAPI filters tab -> Add … Name the filter whatever you wish and your path to your executable should be:
C:Program FilesHeliconISAPI_Rewrite3ISAPI_Rewrite.dll
Click OK on both windows to save your settings. - Next navigate to C:Program FilesHeliconISAPI_Rewrite3
Here we will edit httpd.conf (Note: This is the difference between the pay version and the Lite version. In the pay version you will need to edit the .htaccess file on your web folders root) - Open the httpd.conf file in wordpad and paste in these lines:
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?p=$1 [NC,L] - Save and exit this file.
- To complete your IIS changes, Go to start, run and run the command: iisreset /restart
- Now lets change your WordPress settings. Navigate to http://yourblog/wp-admin
- Navigate to the left side menu bar -> settings -> Permalinks
- Now you get to choose how you want your posts to look. I choose a custom setting and just: /%postname% This is how you see this blog working today.
- Click “Save Changes” and you should see your new friendly URLs!
Tried this step by step and no luck getting it to work. The current version ISAPI rewrite (v3) installs properly and does the majority of the updates above automatically with the exception of step 4. Manually edited the httpd.conf file and WordPress STILL will not allow permalinks.
Any updates regarding this?
Where is your HTTPD.CONF located? it needs to be in: C:Program FilesHeliconISAPI_Rewrite3
Very nice wordpress trick – this works like a charm. No need to install og buy components to help rewriting, this is all you need. 5 minutes after finding this guide, my wordpress blog is now working with url rewritten permalinks, perfect 🙂
Excellent and easy follow guide, i’d recommend it to others.
Hi Kyle- I really wanted this to work, but it doesn’t for me. At first, it just redirects to the generic Index.php that shows all of the info for the PHP version that’s currently installed. So then I renamed that generic index.php file to see if it would redirect to the correct one (the one associated with the blog posts). But it didn’t work…it just 404s on me.
I know you probably can’t answer individual comments, but if you have any insight, I’d love to hear it.
Thanks!
It sounds like your httpd.conf is not correct… can you post it? Also, the httpd.conf needs to be in the folder: C:Program FilesHeliconISAPI_Rewrite3 (or wherever you have it installed)
Hi Kyle-
Thanks for writing back.
Yes, the httpd.conf is located in the C:Program FilesHeliconISAPI_Rewrite3 folder.
The only thing listed in that file is the lines of code that you posted in the article:
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?p=$1 [NC,L]
Before I pasted them, it was an empty file.
As I said, it worked in the sense that it redirected to the “index.php” file that is located in my website’s root folder (which is just the standard index.php file that you get when you’re testing to confirm that PHP is installed correctly). But once I renamed that file (for testing purposes), the redirect would simply go to a 404 page.
So it would appear that the redirect is working somewhat, but it seems to be pointing to the wrong file location. Does that sound about right to you?
In the past, I’ve had a lot of issues with giving the internet user account certain rights to other folders. Do you think that might be an issue here? I wouldn’t think so, since the “work” is being done on the server side, but stranger things have happened.
Thanks again for any insight you can give. I appreciate it.
Okay, a bit of an update. Hopefully this can help us figure out what’s going on.
I changed the fourth line of code in the the httpd.conf file to include the path to the correct index.php file. So the new line looks like:
RewriteRule ^(.*)$ blog/index.php?p=$1 [NC,L]
Since my blog is not in the root directory, this tells the rewrite where to find the correct index.php. I can’t believe I didn’t think of that earlier. However, it still doesn’t function correctly.
Now, no matter which post I click on, it simply loads the “home” page of the blog. The browser address bar shows a nice permalink (www.mywebsite.com/blog/postname), but what appears on the screen is just the home page, not the actual post.
So we’ve taken two steps forward and one step back.
BTW, if I include the “index.php” as my permalink setting in WordPress, everything works great. (e.g. http://www.mywebsite.com/blog/index.php/postname)
But I’d prefer not to include that reference to index.php if I can help it.
Any thoughts?
Jared — I have not tried to have my blog posted anywhere but the root site, but have you tried changing the line:
RewriteBase /
To:
RewriteBase /blog/
I think this might help. As for the security I had unrelated problems to that before but if security was not set correctly I think IIS would request a username and password from you. This issue is something with out ISAPI rewrite. Don’t give up! It is trying to work, we just need to massage the settings a little bit.
Kyle Caulfield
Just tried it.. no luck. It puts up a 404 error with that change if I try to go to the permalink without the index.php in there.
I know absolutely nothing about coding, so please take this with a grain of salt, but I wonder if it has something to do with the “?p=$1 [NC,L]” text in that last line.
It seems to me like the redirect is getting us to index.php, but isn’t pulling the correct post number from there, so it simply defaults back to index.php.
I think I’m stuck with “partly” pretty permalinks, at least for the time being. It’s not the end of the world, but it would be nice to avoid it if I can.
Thanks again for your response. I figured leaving the comments here would be best, just in case we discover a solution that can possibly help someone else with this issue in the future.
No problem Jared — I want to get this working for you! Can you verify the settings in wordpress? Go to Settings in wp-admin and then go to permalinks and let me know how you have that set up. PS the p=? is how wordpress normally finds what post you are looking for, so I think you are on the right track.
Update:
Can you try this in your httpd.conf file:
RewriteBase /blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L]
Thank you for trying, but unfortunately, that didn’t work either. It still just redirects back to the blog’s home page.
In fact, everything redirects back to the blog home page (even 404 errors). Clicking on any link in the blog simply reloads the blog’s default page (even though the address in the browser’s address bar changes).
In my wordpress settings, I have to use /index.php/%postname%/ to make it work. Each time I test it, I remove “/index.php” so that it becomes simply: /%postname%/. But so far, we haven’t been able to make it work without keeping the “index.php” part in there.
This is a shot in the dark, but you said you had /%postname%/ in your setttings… have you tried /%postname% ?
Yep, tried that one too. I’ve even tried it with a “.html” on the end.
It works just fine so long as index.php is in the path, but fails whenever it’s missing.
I’m having the same exact problem Jared is having. Any ideas?
Any solutions if you have it hosted elswhere on IIS6, and not having access to the IIS control panel? Thanks!
Thanks, after weeks of mind-numbing dealings with Apache on Windows I finally did what you said and it works for my WordPress sites.
I believe that some of the problems posted here are because they are not using WordPress since the matched pattern for what you write matches URL’s that contain index.php?p= .
If any other application is being used you will have to modify the httpd.conf accordingly.
If you want a particular pattern matched please email me at me@jcm7.com and I will try to help.
I had the same problem as Jared, and I found a fix for it (for WordPress 2.9.2 with ISAPI_Rewrite3), so I hope it helps you too Jared!
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(index.php)*(.*)$ index.php/$2 [NC,L]
I will explain some more about it on my own blog which should soon be online (at time of writing this) at code.almeros.com.
This worked for me! Fixed a WP site of a friends with this rewrite rule. Thanks!
Almeros,
Thanks for posting. I *really* wanted it to work and was hoping it would. I went over the installation several times to make sure I was doing everything correctly and had typed it in right. I even cut-&-pasted your code to avoid errors, although I did have to add /blog to make sure it was referencing the correct index.php for my installation.
But alas, it did not work. It creates a 404 error when I take index.php out of the permalink path. But here’s the interesting bit…the 404 is a new one. It’s the one that is part of my blog theme, NOT the normal generic 404 from Windows. So it’s something new. And the title bar says “Nothing found for Blog Index Php Blog”, which I’ve never seen before.
I get the impression that we are really close to solving this, and that is has something to do with the syntax in that final line of code. But unfortunately, I’m just not smart enough to crack it. 🙂
Just in case it’s needed, here are all my “specs”:
-Windows 2003 service pack 2 64 bit (IIS running in 32 bit mode)
-MySQL 5.1
-PHP 5.2.13
-Wordpress 2.9.2
I think that’s it, but let me know if you need anything else.
Thanks guys for trying. I’m still keeping my fingers crossed.
Jared — Stupid question, what version of WP are you running? Newest?
See the last line of my previous comment: 2.9.2 Based on what I can see, I think that’s the newest non-beta release, but I could be wrong.
What are you running?
E, ,,
i like load~~~~
I love u blog.
This has been bugging me too for sometime too.
Solution:-
Place this in your .htaccess file or .conf file depending on the version of Helicon ISAPI rewrite you have installed. (.htaccess file to be located in “blog” subdirectory)
Rule:-
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^blog/(.*)$ blog/index.php/$1 [NC,L]
where “blog” is the subdirectory.
Turn permalinks on and use either
/%postname%/ for just a url or
/%postname%.html for articles to end in .html i.e.
Simple 🙂
PlayTEX…nope. Same issue as the last time I tried. It 404’s on me, using the blog theme’s 404 page instead of the generic Windows one.
(although with the spam in your comment, I probably should have guessed)
There must be some setting in/on my system that apparently is different from the others who have gotten this to work. Such is the life of a Windows server, eh? 🙂
I have the same problem as Jared. And none of solutions above helped me either.
WP settings are: /%year%/%monthnum%/%postname%/
httpd.conf:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wp/index.php [L]
And as the result I have:
correct permalinks listed in browser’s address bar though every of them just leads to blog’s index page (with all posts listed).
Can anyone advise with the correct settings?
Hi Jared and all others,
After I posted my last comment I was happily installing everything on my live server just to get yet another 404 problem :S. This time it was IIS. Today I solved it and I wrote a blog article about all my fixes for the WordPress on IIS 404’s. Check it here: http://code.almeros.com/404-wordpress-permalinks-iis-with-isapi-rewrite
I really hope you can find your solution there now, because I know how annoying this is ;).
Greetings to Jared and others.
I solved IIS / mod_rewrite problem for my site but without using Helicon ISAPI_Rewrite Lite. This particular module did not work before I put special PHP-hacks in wp-settings.php (like statement $_SERVER[‘REQUEST_URI’] = $_SERVER[‘HTTP_X_REWRITE_URL’]; in the very beginning of file) and even then I couldn’t fully adjust it.
I overcome Rewrite problem by using Ionics Isapi Rewrite Filter. It did not require anything to be patched in WP though I had to create rewrite rule for every special case.
You can see my configuration file shared.
Maybe it’s a kind of brute force method but it worked for me.
Hey,
If you are getting 404 errors have you actually checked that the rewrite is occurring?
I initially had this error and had to go through the Helicon log files to spot it… on doing so I reconfigured the site settings within plesk and it worked.
P.S last post only contained a link for reference to my blog that works… not spam
What about those who do not have access to the IIS in their hosting?
I cannot even start by installing ISAPI_Rewrite Lite.
Any suggestions?
Lars CMS Meyer said “…this is all you need. 5 minutes after finding this guide”
Yes i agree. I’d say it took me about 5 minutes to get Permalinks working in WordPress.. using ISAPI_Rewrite3 on IIS 6.0
Thanks for posting this – very useful !
update… right after fixing the Permalinks in a WordPress application, (as above) i spent the next 5 minutes undoing it all again as it trashed all of the other sites on the same server 🙁
Not sure what to do now? jump off the nearest high building?
Max – Just enable the isapi filter for the sites you would like a friendly url, not all sites =)
Kyle
First of all, thanks for the providing the step by step process. I followed the instruction and got the permalinks to work. However, it changed the contents of all the pages. Now even on every static page except home, it shows all the blog entries. So, other than home every page looks like the blog page. Is there anything I’m doing wrong? I’d appreciate any pointers you may have.
I haven’t install wordpress on windows myself ,but i think if i do it also in the future, I can reference your method.
For WordPress MU, I followed your instructions but added this to my httpd.conf:
RewriteEngine On
RewriteBase /
#uploaded files
RewriteRule ^(.*/)?files/$ index.php [L]
RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]
# add a trailing slash to /wp-admin
RewriteCond %{REQUEST_URI} ^.*/wp-admin$
RewriteRule ^(.+)$ $1/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule . – [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*.php)$ $2 [L]
RewriteRule . index.php [L]
Everything works great! Thanks for this write up!
Kyle et al,
I have the permalinks working with this code in the IsapiRewrite4.ini file:
RewriteCond %{REQUEST_FILENAME} ^wp-content.*
RewriteCond %{REQUEST_FILENAME} ^wp-admin.*
RewriteCond %{REQUEST_FILENAME} ^wp-include.*
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteRule ^/(?!wp-)(.+)$ /index.php/$1 [I,L]
RewriteRule ^/sitemap.xml$ – [L]
All of the links work fine with that code EXCEPT if I create drop-down menus with parent/child pages. Then when I click a child page on the menu, it displays a URL with the correct parent/child, but the page displayed is actually the parent page.
Anyone else see this?
Ok, all I have to say is that the best solution I’ve found for this is Andy Stratton’s plugin for WP. You just install it, activate it, and make sure that .htaccess is in your root.
It not only handles the rewrites for my top-level pages but FINALLY the child pages on my drop-down menu’s are working.
You can find the plugin here: http://theandystratton.com/2009/get-wordpress-permalinks-working-with-windows-iis-and-isapi-rewrite
Hi,
I have successfully installed ISAPI_Rewrite3_0073_Lite.msi
It seems to be working fine but I’m not sure how I can get it to remove all references of index.cfm from the url for all pages on the website?? Also I am using mura not wordpress
Got it to work on Windows 2003 on IIS 6.0.
Here we go:
1. Install ISAPI Rewrite 3 Lite, just as it is described above.
2. Put this on the C:Program FilesHeliconISAPI_Rewrite3http.conf file:
# BEGIN WordPress
Options +Followsymlinks
RewriteEngine On
RewriteBase /yoursubdirectoryname/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
CheckSpelling On
# END WordPress
Restart IIS only if you’re just installed ISAPI Rewrite. You dont nedd to restart IIS each time you modified this file.
3. DO NOT install plugins or other stuff out there. You dont need it.
4. Enjoy
Thanks NEO, worked great for me!
Thanks Neo. That worked for me 🙂
Well, I have tried all of the above to no avail.
I have IIS 6 (win2003)
using WordPress 2.9.2.
MySQL 5
When trying to visit a permalink page I get this,
CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers.
Is there a way to allow certain extensions such as axd to be used with the filter running?
I set this up as per instructions and the permalinks worked fine but other aspects of my website (especially where using ajax) stopped working and started throwing errors etc.
Any ideas?
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(index.php)*(.*)$ index.php/$2 [NC,L]
Works great!!!!
Windows 2003 IIS 6 with Joomla 1.5
Fully rewrites URL without /index.php/
I have the solution for you when you install ISAPI REWRITE on IIS 6. The Helicon isapi filter is defaultly installed for ALL of your sites. So I had it up and running for my wordpress site but all other sites were scr*** up. So just go to your IIS manage and click on ‘Web Sites’ folder and remove it from the ISAPI filters list. Worked wonderfully for me.
If you dont seem to have any luck, this site helped me loads!
http://www.webafrica.co.za/kb/isapi_rewrite/wpisiapi.html
Will
Visit me at…
http://will.thegulcherfamily.com
Quote: You dont stop playing in life because you’re getting old. You get old because you stop playing.
gogo
http://www.138zzz.com is a good learning website
are you go to 138站长站
Ok. I have installed but do not have an httpd.conf file but an httpd.ini file
I cannot edit the .ini file as it seems to be in use. placing ghe httpd.conf doesnt seem to do anything.
动漫ACG综合性论坛 绯痕学园:http://www.yonkon.com/bbs
Thanks, worked great!
I helped this guy on an IIS with his prophoto theme, but he is running IIS and is using HTTPD.ini for his permalinks, he doesn’t have any install access, but ISAPI should be running.
The content is:
[ISAPI_Rewrite]
# For file-based wordpress content (i.e. theme, admin, etc.)
RewriteRule /wp-(.*) /wp-$1 [L]
# For normal wordpress content, via index.php
RewriteRule ^/$ /index.php [L]
RewriteRule /(.*) /index.php?$1 [L]
# /index.php/ is not really necessary
# RewriteRule ^/$ / [L]
# RewriteRule /(.*) /?$1 [L
now that works fine, say site/test , site/blog/postname , but when you try site/blog/page/2 it fails .. also when running qtranslate, when you go site/en/ it also fails, any suggestions? 🙁 I can’t find help on this
Hi,
Hi Romenov,
1. It works fine only on PHP site.
2. All other ASP and ASP.NET sites are having an issue. images are not loading on and virtual directory are not working properly.
3. I have created virtual ASP.NET website under that WordPress site. it’s not working and gave me 404 error.
4. please assist me.
Thanks! This help me a lot!
I have managed to move a word press site from one server in a subfolder of another server. All seems fine. Apart from one thing. I cannot load the index.php file from the server if accessed like…
http://staging.yourbusinesschannel.com/Business-Development/
but this works fine
http://staging.yourbusinesschannel.com/Business-Development/index.php
Running on IIS6, Helicon Rewrite3
I have tried having default document as index.php, with no luck. the rule in rewrite is…
RewriteBase /business-development/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
Any ideas?
This worked fine for me. My only problem was the with the installation of the rewrite plugin it automatically installed over all websites. So after i skipped step 2 everything was working fine.
Windows server 2003(Vserver)
IIS 6
Wordpress > 3.0
Please help!
I’m working on a MAC, WP is installed on client server (Windows) and I’ve downloaded the plugin, uploaded files and installed, but it still doesn’t work.
You mention things like “You will find this setting by right clicking yourIIS site -> properties -> ISAPI filters tab -> Add … Name the filter whatever you wish and your path to your executable should be:
C:Program FilesHeliconISAPI_Rewrite3ISAPI_Rewrite.dll
Click OK on both windows to save your settings.”
As I’m on a MAC, I cannot see this OR, am I being blind?
Please help 🙁
Hi Billy
What is your web server? IIS or Apache?
Thanks
Kyle
Hi guys,
I have been having the same problems as most of you on here, but have finally cracked it. I guess it will be different depending on your implementation. But, here’s what got me up and running…
I created a Virtual Directory called ‘myblog’ on IIS 6 for my WordPress blog. My blog is accessed via: http://www.mydomain.co.uk/myblog/
My website runs coldfusion pages as default (.cfm) so I changed the default page for my virtual directory to index.php
I then followed the instructions on this post as above.
When editing the httpd.conf file I added the following code:
RewriteEngine on
RewriteBase /myblog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(index.php)*(.*)$ index.php/$2 [NC,L]
Hi,
I worked on this for what seemed like forever. Using Windows 2003, IIS 6.0 and WP 3.01 with BuddyPress and my install is in a directory (not the root).
After much frustration – Neo’s suggestion worked the charm and was able to eliminate the index.php and choose any type of custom permalink. I added the following to a .htaccess found in the same directory as my index.php file.
# BEGIN WordPress
Options +Followsymlinks
RewriteEngine On
RewriteBase /yoursubdirectoryname/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
CheckSpelling On
# END WordPress
Sometimes the easiest of solutions works like a charm.
Hope this helps someone to reduce frustration.
Thanks Neo!
Pat
I folllowed the instructionson
The permalinks for wordpress works but…
On the IIS server I have other websites. They all work fine except a sharepoint site.
When I go to the sharepoint site i get a “http 404 not found error”
The websites use host headers. The name of the sharepoint site is the same as the server.
I have tried many solutions including this one, and still cannot get it working.
All other solutions I have tried still result in a 404 error.
The rewrite rule here gets rid of the 404 error but every link just displays the index.php and not the actual page.
ISAPI REWRITE 3 is working fine I have confirmed this by testing other rules.
I have set cgi.fix_pathinfo=1 in the php.ini
i tried step by step what you said, it worked fine for wordpress permalink SEO URLs but it ruined my asp.net 2.0 SEO URLs. so i deleted it.
Permalinks for wordpress work again, no more errors :). Thanks for the tutorial!
Right on! Thank you so much for this fix. Due to a VPN error we decided to use a virtual terminal to upload a website. Your plugin was necessary on the VM; worked like “magic” (After a day spent looking for fixes). Thanks!!!!!
None of these suggestions works for me. No matter what I try, I always get the IIS 404 error. Sux I can’t do this!!
Windows Server 2003 SP2
IIS 6.0
MySQL 5.1
Wordpress 3.0.1
Hi,
Thanks for solution, it worked fine for me but I have got one issue.
When I updated the httpd.con file my other asp.net site links stopped working.
Is there any settings in this file by which I can limit it to only one website rather than whole iis?
Thanks in advance.
Mustaq
Hi,
i have setup the wordpress blog on local and is running well but when i set up on staging the permalink not work bcoz there is IIS server is there any way to do url rewrite through code or also tell me to transfer the blog to Linux sever.
Thanks
FYI, because I spent two days figuring this out:
If you installed ISAPI_Rewrite from the installer package, you should not be manually adding an ISAPI filter to any of your sites, despite what instructions at various places on the Internet tell you.
Doing so will cause problems because the installer package already installs a global ISAPI filter for you. Adding another ISAPI filter on top of this causes the filter rules to run twice, which is not good.
See this link for verification from Helicon Tech: http://www.helicontech.com/forum/7274-HTTP_X_REWRITE_URL_Problem.html
Hope this helps some people.
hay i’m working on linux server, its same on it.. thanks buddy
Since PHP5.3.3.3 isapi has went out the window and is no longer packaged with PHP. Replaced with fastcgi so the best
bet with windows platform is Fastream IQProxy for half the cost.
Thanks A lot
It worked perfectly!
Follow the steps and it work like a charm.
Hey guys,
Have been following some of your problems as I’ve had some myself. After seeing Richard Jones comment and having a dig about it seems that a lot of problems maybe caused by IIS running filters either side of ISAPI_Rewriter. I think only affects people running ASP.NET 4 though it could effect others.
Firstly I had problems with every page request bringing up the home page then once I’d got over this I found they were all 404s! My suggested course of action if your getting 404s all over the place, add this to your themes 404.php somewhere it’s going to be visible to you:
This will show what is hitting WordPress; I noticed my URL request was being violated by eurl.axd/[random string] so it looked like this:
http://www.example.com/index.php/about/eurl.axd/b852863f2d5e9841b5d8b79b44ac02e8/
This was causing my 404s. Thanks to some help from the guys on stackoverflow I managed to mod my htaccess to remove this from my requests. I have posted my (so far fully working) htaccess code below. Hope it helps!
————-
RewriteEngine on
RewriteBase /
# This is used to strip ASP.net eurl.axd bits
# from the URL so wordpress can use permalinks
# For the root
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^eurl.axd/[0-9a-f]+/$ index.php [NC,L]
# For internal permalinks
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/eurl.axd/[0-9a-f]+/$ index.php/$1 [NC,L]
Spoke to soon! It works but breaks the root of wp-admin. (If only you could edit comments!). Anyone find any other issues?
This should work though:
————–
RewriteEngine on
RewriteBase /
# This is used to strip ASP.net eurl.axd bits
# from the URL so wordpress can use permalinks
# For the root
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/wp-admin/
RewriteRule ^eurl.axd/[0-9a-f]+/$ index.php [NC,L]
# For internal permalinks
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/wp-admin/
RewriteRule ^(.*)/eurl.axd/[0-9a-f]+/$ index.php/$1 [NC,L]
Super-Duper web site! I’m loving it!! Will arrive again again – taking you feeds also, Thanks.
Hello. Good job. I did not expect this on the Wednesday. This is a terrific story. Thanks!
This works great, I migrated from apache to IIS and this was the missing link, thanks a bunch.
this works fine for me as long as i use one of the standard options. If I use as above, /%postname% then the posts work but the archive links per month fail!
Solution to /index.php/ problem:
I was having the save issue as Jared earlier with the site needing to have /index.php/ to show up. After some digging I came to a comment on another site that this as the last line in the .conf file:
RewriteRule ^(index.php)*(.*)$ index.php/$2 [NC,L]
By changing it to that I was able to get the permalinks working on iis6 without the /index.php/ having to be there.
So I was looking for a way to limit the url rewrite to one domain since we have multiple sites on our IIS 6 web server and the the base httpd.conf rules were affecting all of the sites and breaking some of them.
So I was looking for a way to limit mod_rewrite to one domain. To affect only one domain for permalinks I had to add this Rewrite Condition: RewriteCond %{HTTP_HOST} ^(www.)?mydomain.com$
This applied the mod_rewrite rules only to the one domain as desired.
Complete httpd.conf to apply mod_rewrite to one domain
RewriteBase /
RewriteCond %{HTTP_HOST} ^(www.)?mydomain.com$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?p=$1 [NC,L]
Hope this saves you time!
Has anyone else had problems with Page links? I still 404 on pages, but postings work.
Hi,
I try this and install it on my server.
But I want to change my URL form
1) http://localhost/XYZ.Web/HomePages/Job.aspx
2) http://localhost/XYZ.Web/HomePages/Post.aspx
3) http://localhost/XYZ.Web/HomePages/Emp.aspx
4) http://localhost/XYZ.Web/HomePages/Test.aspx
to one only
like
http://localhost/XYZ.web/
how it is possible and where should I write it to change
I am new so I do not know how to rewrite URL and where to write.
Please reply me.
Hi,
I tried above step and install ISAPI in IIS 6.0
Then change in httpd.comf file as mention above
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?p=$1 [NC,L]
then I did change like this
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?p=$1 [NC,L]
RewriteRule ^/home /Home/Job.aspx
but it gives me error page not found 404
so now what should I do.
I have not put my website in wwwroot but in separate folder
in C:/Publish/WEBSite.
Creating Virtual directory for the website and host it
I have added the ISAPI filter to your my website
C:Program FilesHeliconISAPI_Rewrite3ISAPI_Rewrite.dll
Click OK on both windows to save your settings
as well as
In my website directory folder also.
Gaurang
This worked flawlessly. Thanks for taking the time to post these instructions.
hmmm I managed to make it work but….. It doesn’t work 100% in every browser, the only browser that does it perfectly is firefox all the others break after going deeper in the links. I am running buddypress on iis6 using isapi rewrite 3. any help would be greatly appreciated. Thanks
hi all,
I am pulling my hair out over this.
I have followed all the instructions at the top of this page but as soon as I switch from the default setting to a custom structure (or one of the other options) I can no longer view my blog at even, not even the home page.
To access my blog I have the following URL
http://beta.policybee.co.uk/blog/
Please help 🙂
I added this to my htaccess and it started working again. Thx
Thanks very usefull!!
OMG finally I have been working with e-commerce plugin for word press and nothing worked, I didn’t have any issues using the permalinks but the add to cart would not work. with this suggestion it works finally.
Thank you so much almeros and everyone on here.
Almeros
March 26, 2010 at 8:39 am
I had the same problem as Jared, and I found a fix for it (for WordPress 2.9.2 with ISAPI_Rewrite3), so I hope it helps you too Jared!
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(index.php)*(.*)$ index.php/$2 [NC,L]
I will explain some more about it on my own blog which should soon be online (at time of writing this) at code.almeros.com.
Extremely Helpful, thank you for the post
worked a treat… I have been trying to do this for months. finally a good guide that actually works
Thanks very much
XItpLk http://djIjw3MnccVop6a5hFgql.com
Guys can anyone help me on how to change my permalinks on WP!
Please let me know if you’re looking for a writer for your blog. You have some really great posts and I think I would be a good asset. If you ever want to take some of the load off, I’d absolutely love to write some articles for your blog in exchange for a link back to mine. Please blast me an e-mail if interested. Kudos!
I had problems with the example httpd.conf not working. It was not reading QueryString values. I solved this in WP 3.1.x by using this:
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
httpd.ini
[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP
# Rules to ensure that normal content gets through
RewriteRule /sitemap.xml /sitemap.xml [L]
RewriteRule /favicon.ico /favicon.ico [L]
# For file-based wordpress content (i.e. theme), admin, etc.
RewriteRule /wp-(.*) /wp-$1 [L]
# For normal wordpress content, via index.php
RewriteRule ^/$ /index.php [L]
RewriteRule /(.*) /index.php/$1 [L]
Totally worked
#:-) Just to let you know that I got a hyper link to your web site from search engine result advertising visionary Themelis Cuiper – you are doing an awesome job as he provides a hyper link to you!
Thanks for that, saved me more head banging in my migration from SubText
Who knows R there as good professional reputation service than ReputationUP.com? Paccar? They only cost $49 which is not much, unfortunately… 1 have to provide 5 more options for my boss. :>
I have the permalinks working, but now I can’t delete or update plug-ins. I received messages like the following:
Plugin could not be deleted due to an error: Could not fully remove the plugin(s) hello.php.
“hello.php” changes depending on the plug-in. I can install new plug-ins, I just can’t delete them.
I’m on a course at the moment Sandra Forum Model
720223
Would you like a receipt? Laurie Model kml
Will I be paid weekly or monthly? Cute Russian Models
edb
Read reviews about Blu-ray 3D player, visit Blu-ray 3D player reviews
excellent material from your site,,great stuff
i will most certainly vist again..
thankyou
almeros –
I have the same set-up as you and used your code and it worked perfectly. THANK YOU! HOURS spent trying different things and i finally tried your post and it worked. THANK YOU AGAIN!
***********************************************************
I had the same problem as Jared, and I found a fix for it (for WordPress 2.9.2 with ISAPI_Rewrite3), so I hope it helps you too Jared!
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(index.php)*(.*)$ index.php/$2 [NC,L]
I will explain some more about it on my own blog which should soon be online (at time of writing this) at code.almeros.com.
*****************************************************
I just follow your instructions and it works perfectly on Win2003/IIS6.
Thanks a lot.
Hi all. I just found a solution for my (yours) headaches !
Setup: WordPress 3.2.1
Microsoft Windows Server 2003, IIS 6 running on VPS
ISAPY_Rewrite 3
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/wp-admin/.*
RewriteRule .* /index.php [L]
In httpd.conf
Source: http://www.helicontech.com/forum/18046-ISAPI_ReWrite_with_Wordpress_32_on_IIS6.html (at the bottom)
ENJOY !
worked like a charm. Thanks for the blog
No need to install any ISAPI filter to remove the index.php from WordPress permalinks.No need of .htaccess file..Use these simple steps to WordPress Permalinks in IIS 6.0 using Custom 404 Redirect for Windows Shared hosting/manas hosting or any windows shared hosting.
http://dotnetcodebytes.blogspot.com/2011/11/remove-indexphp-from-wordpress-on.html
Hi.. Thanks for sharing and writing the post and you took your time to write it,s I appreciate it.. One question I want to ask is.. Does this method still work in latest wordpress version which is 3.2.1 and latest windows server..waiting for your reply..thanks Alam
Hi Guys
I found this thread very informative! We host many sites on Windows Servers using IIS6 and had this 404 issue with WordPress though the main thread above and many of the others below did not rectify the issues fully but with a bit of playing this was what we found worked 100%
install ISAPI_Rewrite Lite as above but when finished if multiple domains on the server within IIS remove this filter from the the main “Websites” properties and just add the filter to the individual domains that require it. This needs to be done or the sites running .NET go tits up and do not display properly.
Then add these lines to the Httpd.conf file:
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(index.php)*(.*)$ index.php/$2 [NC,L]
Make Sure if wordpress puts a htaccess file within the website space this is removed.
Wallah thats it everything works 🙂
hi everybody, my serv using now 2 sites: wp and discuz
My discuz in httd.conf
# RewriteEngine
RewriteEngine On
RewriteBase /
# Rewrite
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^topic-(.+).html$ portal.php?mod=topic&topic=$1&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^article-([0-9]+)-([0-9]+).html$ portal.php?mod=view&aid=$1&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(w+)-([0-9]+)/(.*).html$ forum.php?mod=forumdisplay&fid=$1&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^baiviet/(.*)-([0-9]+)-([0-9]+)-([0-9]+).html$ forum.php?mod=viewthread&tid=$2&$3&page=$3&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^group-([0-9]+)-([0-9]+).html$ forum.php?mod=group&fid=$1&page=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^(.*)-([0-9]+)/(.*)$ home.php?mod=space&$1=$2&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^blog/(.*)-([0-9]+)-([0-9]+).html$ home.php?mod=space&uid=$2&do=blog&id=$3&%1
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteRule ^([a-z]+)-(.+).html$ $1.php?rewrite=$2&%1
That’s work great!
and now, i wanna rewrite url my wp site , in httpd.conf file, what i need write on??
No need to install any ISAPI filter to remove the index.php from WordPress permalinks.No need of .htaccess file..Use these simple steps to WordPress Permalinks in IIS 6.0 using Custom 404 Redirect for Windows Shared hosting/manas hosting or any windows shared hosting.
No need to install any ISAPI filter to remove the index.php from WordPress permalinks.No need of .htaccess file.
http://dotnetcodebytes.blogspot.com/2011/11/remove-indexphp-from-wordpress-on.html
Hi just tested a while ago, and I came up to the successful one.
thank you so much it is a good wordpress tricks.
By mistake I have installed a php script in my root directory, where wordpress is available. After that my all permalinks has been change. After modifying .htaccess file and modified file permission by ftp now My site site is almost ok. Now i can’t log-in admin panel, when i am giving admin user name and password then url redirect to http://investorsbd.com/index.php/wp-login.php (extra index.php has shown) and nothing found for index php login. How can i remove that extra index.php for log-in my wordpress admin control panel? Please help me!
Thanking in advance.
Hi all
I have tried all of these .htaccess configs, nearly all of them actually produce the desired url re-wite, but they all break my sites links to css, images and js etc so I get an un-styled site.
Any ideas?
Thanks
Very useful information. Thank you!
Hello, I have IIS6 and both PHP and Coldfusion.
So, i need to “disallow” Isapi_rewrite in a specific domain but now is running in all the websites in this server:
I added this line to the basic configuration:
RewriteCond %{REQUEST_FILENAME} !(my.domain.in)
because I don’t want to run with this, but id does not work… how is it?
Thanks for this Blog Entry and sry for my bad english, i am german, but you helped me alot with this informations.
Guys, after trying everything out there, I followed your instructions, and it works like a treat on Windows 2003 x64 with IIS6.
Thanks so much.
I had 3 blogs on IIS6 win2K3, two with static wordpress pages as home and the other a news site http://news.liberatedstocktrader.com
The only solution that worked on all 3 blogs and did not screw up the CSS was
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(index.php)*(.*)$ index.php/$2 [NC,L]
Thanks almeros
Hi Don,
Regarding it breaking the CSS, try adding this line as a condition:
RewriteCond %{REQUEST_URI} !^/wp-content/.*
I got the idea from Ruskyj’s post.. it’s 5:30am and I’ve now finally got it working!!
Great blog.
Thank you Kyle! It worked perfectly.
Works like a champ. Thanks dude
Thanks so much for your tutorial on this. Very easy to follow and worked like a charm!
I just set this up on Windows Server 2003 running IIS 6 and Parallels Plesk 11.x. For anyone running 2008 with IIS 7 and newer there’s a different solution available.
I’m haven’t played with IIS and since 2.0 so a bit out of practice, greatly appreciate your sharing =o)…
Thank you so much… It works great!!!!
Kyle, No words to thank you!!!
This works perfectly. Thank you for posting this!
Perfect. Solved. Thank you very much! 🙂
Thank you for keeping this post up. I had to migrate a site and this help a lot.
Thanks for writing back.
Yes, the httpd.conf is located in the C:Program FilesHeliconISAPI_Rewrite3 folder.
The only thing listed in that file is the lines of code that you posted in the article:
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?p=$1 [NC,L]
Before I pasted them, it was an empty file.