Configure url rewrite pseudo-static diagrams in thinkphp under iis

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.