In a previous post, I mentioned that I was investigating a way to use real permalinks without using any of the ISAPI mod_rewrite dlls. For the uninitiated, mod_rewrite is not natively supported in IIS (Window’s server), and to get the same functionality, you have to install separate programs. I’ve done that and that is how this blog has survived on a Windows server for the past year or so.
I was convinced that needn’t be the case though. There must be a way to have permalinks without having to install a whole separate mod_rewrite program (or extension). I detailed my plan in this post.
Well, I finally got around to it – and the plan worked!
Here’s the gist of it. It uses custom 404 redirect to send all “Page Not Found” errors to a script that reads a bunch of regular expressions (don’t worry, you don’t have learn regular expressions to use this) and figures out what page to feed back.
Now, some people may find my solution a bit odd considering it is written in ASP. You used ASP to extend wordpress?? Yes, and it worked :).
More detailed instructions, and a link to the needed files are located here:
DesiTech says
Hi Tom,
I did exactly what you mentioned and was able to run “Create a new blog” link only. Rest of things are not working still.
Before uploading your files I was not even able to get this “create a new blog” link working.
my site is like this: http://blogs.mysite.com
and my new blogs will be: http://blogs.mysite.com/username
All WP files & urs files are in root dir
Please help me resolve this issue on my hosted iis server.
thanks a lot.
hartini says
Thanks so much for this – it worked like a charm! However, I’m having problems with password-protected entries. The page will just refresh after keying in the correct password. I then gave the ugly URI a try and that allowed me entry into the post. Yay! However, again, I’m not able to make comments without seeing this error: Error in my_thread_global_end(): 1 threads didn’t exit
My comment is saved tho, just the error message popping up…
This is minor but I hope there’s a fix for this. BTW, just upgraded to WordPress v 2.2.1 and disabled wp-cache.
Tom says
Hi All,
Sorry I won’t be able to answer all the recent comments. Things to keep in mind here are:
1. Your blog has to be on an IIS server and it won’t work with a .htaccess file. It has to have a htaccess.txt file.
2. I have not tested this with the multi-user edition of wordpress, so cannot help you there.
3. If the page just hangs, it could be because the server is blocked from fetching the page (it has to look at the page as if it was a user).
4. Password’s might not work because of the way it gives back the page. The way this script works is it pretends to be a user looking at the site and then it shows what it saw as the 404 error page. That’s why it works. There is nothing in the script that passes the passwords or cookies along, so anything that relies on cookies will not work.
Thus, it will not work with people who are logged into your blog.
DesiTech says
hi,
I have installed your files in root dir.
http://blogs.mysite.com
Also redirected 404 error page to errorpage.asp
But when I click on blogs its not showing up. And when I remove permlink it works only for admin blogs. But with any of permlink options its not working.
I have hosting with thrid party on IIS server. Please help me resolve this issue.
thanks,
DesiTech
Lokesh says
This worked for me in the first shot.I was scratching my head for three days.Thank you ,i love this…
I have one doubt.Is this search engine friendly
Einar Egilsson says
While I appreciate the effort that’s gone into this script, there is a much simpler solution available which only requires a 3 line php file. I’ve documented it here:
http://tech.einaregilsson.com/2007/07/30/pretty-wordpress-permalinks-on-iis/
Rakesh says
hi
I am made one blog site url is http://www.2bincdev.com/jra/. Now what I want is, if you scroll down the page you will find a link called “comment” and Email. So I want to make both of them color change from black to red. I have tried so many options by making change in CSS but it doesn’t help. Can you pls suggest me any solution for this
Thanks
Tomas says
Hello and thank you for the script. I have tried number of solutions but none of them are working. (including this)
I think that the issue is that even the permalinks that start with index.php don’t work.
i.e. only the first option with indhttp://www.mobiledeployments.com/?p=123 works. If I change it to http://www.mobiledeployments.com/index.php/2007/08/21/sample-post/
it will not work either and thus I suspect that the custom permalinks are not working.
I have my own IIS installation and I can control any settings – I am willign to donate some $ to anybody who can help please.
Thx
Tomas
Tom says
Tomas,
You are running Apache so this solution won’t work for you. You need to upload a real .htaccess file. You are using a server that WordPress was made for.
Follow the instructions in the WordPress Permalinks area.
Best,
Tom
jigs says
Tom, have you tried this with https (SSL) website ?
It seems MSXML cannot work with SSL sites (or atleast with wild card certs – *.xyz.com)
I get the following error (on the line xml.send):
msxml3.dll error ‘80072efd’ A connection with the server could not be established
I think I resolved all other MSXML issues by changing to the following code:
Set xml = Server.CreateObject(“Msxml2.ServerXMLHTTP.3.0”)
‘suppress ssl error messages using below
xml.setOption 2, 13056
but cannot get past the connection error.
Thanks
-jigs
Abhi says
I applied the whole method but now I get 500 Internal server error.
Tom says
Please take a look a this post explaining a better way to get permalinks in IIS using 404 redirect pages:
http://www.keyboardface.com/archives/2007/09/07/update-for-wordpress-permalinks-on-iis/
scott says
Tried this and it’s great!! Thanks.
Sidenote: This page is really hard to read however. Black text on dark red/black background?! (Opera 9.0)
Alfalock says
Стильные стальные двери Форпост нового поколения
http://www.alphalock.ru/
HocatoonArcax says
un programma per scaricare?Scusates, potete scrivermi e mettere il link dei migliori scansioni online? Possibilmente in italiano…. ma accetto anche di lingua straniera! Grazie mille a chi mi aiita! 🙂
http://www.chatt-gratis.net/javachat/immagini/amore.gif
georseshemi says
Most peoples says that you need, other that you dont.
So how to choice?
jaume says
Hi, I have a similar problem with Permalinks on WordPress, IIS.
My site was installed XAMPP, not IIS.
I put the file wp-404.handler.php as shown on your website, but the principle works if the Hosting (IIS6) they turned me 404 error, no longer works.
If I do not activate the 404 error, if it works, but I have no error page and I still have the blank page, but at least Permaliks function.
Now I have the default Permalinks panel in WordPress.
I do not know whether to install IIS6 on Vista, I need to install Windows Server ..?
Thank you very much.
Good site this.
factshelf.com says
fantastic! I searched the web for too long for a solution like this. But I have a related issue. If my permalink structure is like /%postname%/, the pages works fine but any request with index.php/anything brings the homepage except the 404 error page. If the permalink is set to include the index.php phrase, then the 404 page works for invalid requests. Please help me how to use the permalink format mysite.com/%postname%/ having the 404 error pages functioning. Thanks in advance.
impopanuadymn says
Hello,
What are the best web hosting company?
I’m trying to set up a web site for my new business.
appreciate your feedback,
-Nick