URL Rewriting for WordPress under IIS

y0ungs 介绍的文章,虽然是英文的但是比较易懂,且有大量图片说明,就不翻译了。转贴过来介绍给大家!

是一篇关于WordPress Rewriting规则的文章,根本上解决Windows系统下的Rewriting规则问题

This ISAPI filter removes the index.php From wordpress’s permalinks on IIS,making your permalinks more pretty and SEO friendly.

Introduction

Because IIS does not support mod_rewrite modules for rewriting url, so whenever you try to use permalinks, you always get something like this:

http://www.deanlee.cn/index.php/2006/09/02/…../

this filter can remove the index.php From url automatically.it’s easy to use,just install it,and no further config is necessary if you are running your wordpress in the root directory of your site.

download

you can download binary here:

* WordPress permalinks Filter version 1.1 X86 (for 32bits windows)
* WordPress permalinks Filter version 1.1 X64 (for 64bits windows)

download C/C++ source files here:

* WordPress permalinks Filter Project files (MS Visual Studio 2005)

Key benefits:

Speed.

this plugin is writting in C/C++,because it’s designed dedicated for wordpress,so the program’s logic is very simple and no regular expression is used.it’s extremely fast.

Living Demo

You can take my site as a living demo:), navigate through my sites,watch the ‘pretty’ address in the browser.

limitation

You must have administrator privileges in order to install this plugin.

Installation

You should copy WordPressPlugin.dll msvcr80.dll and config.ini to the target machine and register it as an ISAPI filter using IIS MMC snap-in. WordPressPlugin.dll should be registered at a particular site level . Filter will try to load main configuration file (config.ini) From the folder Where filter DLL is located.

if WordPress is installed in the root directory of your site,you don’t need modify the configuration file.otherwise, if you set up WordPress as a virtual directory,you should change it to the path of your virtual directory.

for example,if WordPress is installed as the virtual directory : mywordpress, you should change it From ‘/’ to "/mywordpress/" in config.ini.

after register,goto your wordpress’s admin panel->options->Permalinks,make sure you have removed the index.php From your permalink structure.

====详细安装图文说明====
I have my blog setup on a dedicated Windows 2003 server running IIS 6.0 with WordPress installed. The permalinks were not working when I changed it to a date and name based format because it uses an htaccess file. So I needed to find an easy fix for my permalink problem. I found it on Dean Lee’s blog but the instructions were a little confusing so I Rigged them for you.

Step 1: Download the .dll files and ini file.
Setp 2: Extract the files
null
Step 3: Copy & Paste them to the root directory of your blog folder
null
Step 4 (If installed in a virtual directory): Change it to the name of your virtual directory in the config.ini file. I don’t have mine setup in a virtual directory so i didn’t change anything. I did however, have it setup in virtual directory on my companies website called blog so this is what that looks like:
null
Step 5: Go to the IIS manager and right click on your site. Then left click on properties.
Step 6: Register WordPressPlugin.dll. Click the ISAPI Filters tab and then the click the Add button:
null
null
null
Step 7: Browse for WordPressPlugin.dll by clicking the browse button:
null
Step 8: Change your php.ini file; open windows explorer and search for php.ini
null
Step 9: Open php.ini with notepad; then search for cgi
null
Step 10: Find “; cgi.force_redirect=1″ and remove the “;” From the beginning of the line and if it is equal to 1 change it to 0. Then add the line “cgi.fix_pathinfo = 1″ with out the quotes.
null
Step 11: Restart IIS by going to the command prompt and typing “resetiis” without the quotes.
null
null
Type CMD
null
Type iisreset

Step 12: Go into your WordPress site admin then go to Options->Permalinks
null
Step 13: Click on the “Date and Named Based Format” radio button
null
Step 14: Then switch to “Custom, specify below” and remove the /index.php. Make sure to leave a / in front of the %year
nullordPress_under_IIS
Now your permalinks should be working (hopefully). I have done it on two different Windows 2003 servers running IIS 6.0 and they both worked great. The first time it didn’t work because I needed to restart IIS so don’t skip that step. Your ISAPI Filters tab back in the IIS manager should now have a green arrow pointing up like this.
null
Good Luck

============

this plugin has been build with /MT switch(multithread, static CRT) instead of /MD,if you still failed to load this plugin,download vcredist_x86.exe From microsoft,run it on the target computer,this installs all Visual C++ libraries as shared assemblies.

随机文章

  • Eagles - Hotel california
  • Canon SD750 IXUS 75
  • 2007年度总结(QQ群版)
  • 世界上最远的距离...
  • 过年回家 到赶集网买火车票
  • 与大悲寺对比,看看少林寺有多丑陋
  • 0 Responses to “URL Rewriting for WordPress under IIS”


    1. No Comments

    Leave a Reply