Keyboard Face

when you find QWERTY imprinted on your cheek - it's time to go to bed.

Tags

asp CSS css menus dreamweaver flash gallery2 hosting iis7 Javascript jquery jquery ui left mac mssql os9 php printer rdp SEO sql sql server windows wordpress

WordPress PermaLinks in IIS without the mod_rewrite

May 21, 2006 by Tom 171 Comments

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:

WordPress Permalinks in IIS

Filed Under: Installing Wordpress

Comments

  1. DesiTech says

    July 17, 2007 at 10:17 am

    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.

  2. hartini says

    July 17, 2007 at 10:16 pm

    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.

  3. Tom says

    July 18, 2007 at 10:48 am

    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.

  4. DesiTech says

    July 18, 2007 at 11:29 am

    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

  5. Lokesh says

    July 27, 2007 at 8:19 pm

    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

  6. Einar Egilsson says

    July 30, 2007 at 4:42 am

    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/

  7. Rakesh says

    August 13, 2007 at 2:48 am

    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

  8. Tomas says

    August 21, 2007 at 10:21 am

    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

  9. Tom says

    August 28, 2007 at 6:22 pm

    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

  10. jigs says

    August 30, 2007 at 1:32 am

    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

  11. Abhi says

    September 9, 2007 at 8:30 am

    I applied the whole method but now I get 500 Internal server error.

  12. Tom says

    September 10, 2007 at 11:37 am

    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/

  13. scott says

    April 8, 2008 at 9:00 pm

    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)

  14. Alfalock says

    August 23, 2008 at 8:37 am

    Стильные стальные двери Форпост нового поколения
    http://www.alphalock.ru/

  15. HocatoonArcax says

    December 7, 2008 at 6:02 am

    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

  16. georseshemi says

    December 23, 2008 at 5:37 am

    Most peoples says that you need, other that you dont.
    So how to choice?

  17. jaume says

    May 27, 2009 at 5:32 pm

    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.

  18. factshelf.com says

    June 7, 2009 at 4:09 am

    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.

  19. impopanuadymn says

    June 11, 2009 at 3:48 am

    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

« Older Comments

Leave a Reply Cancel reply

Your email address will not be published.

Pages

  • About Me
  • WordPress Permalinks in IIS using Custom 404 Redirect

Archives

  • May 2019
  • February 2019
  • January 2018
  • May 2016
  • April 2016
  • December 2015
  • November 2015
  • May 2015
  • April 2015
  • January 2013
  • March 2012
  • February 2012
  • December 2011
  • September 2011
  • August 2011
  • November 2010
  • October 2010
  • June 2010
  • April 2010
  • March 2010
  • February 2010
  • January 2010
  • December 2009
  • November 2009
  • September 2009
  • August 2009
  • July 2009
  • April 2009
  • March 2009
  • February 2009
  • January 2009
  • November 2008
  • September 2008
  • July 2008
  • June 2008
  • May 2008
  • April 2008
  • March 2008
  • February 2008
  • December 2007
  • October 2007
  • September 2007
  • August 2007
  • July 2007
  • June 2007
  • May 2007
  • January 2007
  • November 2006
  • October 2006
  • September 2006
  • August 2006
  • July 2006
  • June 2006
  • May 2006
  • April 2006
  • March 2006
  • February 2006
  • January 2006
  • December 2005
  • November 2005
  • October 2005
  • September 2005
  • May 2005

ASP.NET Resources

  • Keven Roth’s Code Library
  • Lemon Law

Blogroll

  • Arin Morfopoulos
  • Jamie
  • Physical Therapists

Code Search Engines

  • Koders
  • Krugle

CSS & Design Resources

  • CSS Basics

Other

  • Amazon
  • Car Repair Questions
  • Cool Quizzes
  • Delphi LA
  • Physical Therapy Clinic Directory
  • Quickbooks Questions
  • Secret Santa Game

Site\'s I\'ve Designed or Helped With

  • Area Rugs
  • Dental Implants
  • Dental Website Design
  • FHA Loans
  • Secret Santa Gift Ideas