Solve the problem that thinkphp cannot rewrite URLs in iis6.0 environment

Source: Internet
Author: User
I recently developed a video teaching system and used apache + php + mysql environment locally for development. I have not encountered any redirection problem. I only need to configure it in the apache environment. 1. httpd. the mod_rewrite.so module is loaded in the conf configuration file. 2. change AllowOverrideNone to None to All.

I recently developed a video teaching system and used apache + php + mysql environment locally for development. I have not encountered any redirection problem. I only need to configure it in the apache environment.

1. the mod_rewrite.so module is loaded in the httpd. conf configuration file.

2. change AllowOverride None to All

3. make sure that URL_MODEL is set to 2.

4. Save the following content as a. htaccess file and put it under the same directory of the entry file

  1. RewriteEngine on
  2. RewriteCond % {REQUEST_FILENAME }! -D
  3. RewriteCond % {REQUEST_FILENAME }! -F
  4. RewriteRule ^ (. *) $ index. php/$1 [QSA, PT, L]

However, this configuration will cause errors in iis because iis does not read. htaccess. download ISAPI_Rewrite3_0073.msi from the Internet and click install according to the Wizard.

Enable ISAPI_Rewrite

Delete the default rule. Otherwise, an error will occur! Edit ---> delete a rule.

In this way, the. load heaccess file is implemented.

However, the official trial period of this software is only 45 days, which means it will not work after 45 days. how can we work? The best solution is

1. stop iis.

2. overwrite the dll file in the Rewrite cracking folder to ISAPI_Rewrite.dll and ISAPI_RewriteSnapin.dll in the installation directory. if you are prompted to use the file, rename the dll file to be overwritten and copy it;

3. open the httpd. conf file in the installation directory, enter the following content and save the file, so there is no limit on the number of days to use;

RegistrationName = wlqcwin

RegistrationCode = 2EAD-35GH-66NN-ZYBA

4. after installation, remember to grant the read permission to the network service in the ISAPI_Rewrite3 software installation directory.

5. start iis.

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.