The rewrite pseudo-static configuration method is simple. We use the official method. I used apache before, so I don't know how to configure rewrite pseudo-static in iis, so it took a long time to load the rewrite and then write it in httpd. ini.
Once written, the tp framework is used. The local environment is Apache + mysql + php.
I actually guessed that it would be a little difficult to configure iis with pseudo-static state in windows, but I didn't expect it to be so boring, so it took a long time to do a good job. I once again explained that persistence can win. Next, I will share my successful methods with you. I hope to help anyone who needs them (vps configuration is successful ).
Download iis rewrite: Rewrite.zip 99KB
Then upload the package to the server and decompress it to the directory (it is better for anonymous users to have the permission to read it, as described on the Internet)
Right-click your site and select "properties". The dialog box shown in is displayed, "ISAPI filter"-> "add"-> "Browse"-> select rewrite. dll Directory, and then confirm.
Finally, enter your rewrite Directory, which contains an "httpd. ini "configuration file, delete all the content, paste the following sentence (the code is only applicable to ThinkPHP ):
The Code is as follows: |
Copy code |
[ISAPI_Rewrite] CacheClockRate 3600 RepeatLimit 32 RewriteRule (?! /Dh )(?! /PhpMyAdmin )(?! /Public) (. *) $/index. php/$1 [I] |
The red-colored code and the "Public" behind it mean to exclude these directories without pseudo-static (for example, the background does not need pseudo-static ).
Restart iis and you will find that it is OK. It took me half a day to get it done. I finally breathed a sigh of relief.