IIS7.5 remove the index. phpweb. config configuration file

Source: Internet
Author: User
Tags codeigniter
There are a lot of tutorials and Code on removing index. php In the forum, but the tragedy is that you can configure your own server, and the server is either Apache or IIS6 -... There is no configuration in IIS7.5. I think there should be a lot of space provided by service providers, and some files cannot be modified. I once saw a quarrel in the group.

There are a lot of tutorials and Code on removing index. php In the forum, but the tragedy is that you can configure your own server, and the server is either Apache or IIS 6 -... There is no configuration in IIS7.5. I think there should be a lot of space provided by service providers, and some files cannot be modified. I once saw a quarrel in the group.

There are a lot of tutorials and Code on removing index. php from the Forum, but the tragedy is that you can configure the server on your own,
And the server is either Apache or IIS 6 -...
There is no configuration in IIS7.5.

I think there should be a lot of space provided by service providers, and some files cannot be modified.
One time I saw a person in the group clamoring for spam from the service provider and refused to modify the httpd. conf file,
What do you mean? I can change it to pseudo-static... I also say that the server is spam and does not support URL Rwrite.

In fact, IIS7.5 is supported, and the configuration level and flexibility are quite high,
As long as you know how to configure web. config rules, you can completely ignore the service provider. You know this...
What 404,500 etc. Filter files, restrict access and so on is not a problem.

From this point of view, many people will make such embarrassment because they do not understand Web. config and blindly worship the tutorials they see.

If you don't want to talk about it, go directly to the Code:
Web. config

XML











Input = "{HTTP_HOST}" pattern = "^ (. *) $"/>
Input = "{REQUEST_FILENAME}" matchType = "IsFile" negate = "true"/>
Input = "{REQUEST_FILENAME}" matchType = "IsDirectory" negate = "true"/>

Type = "Rewrite" url = "index. php/{R: 1}"/>






Value = "index. asp"/>
Value = "index. aspx"/>
Value = "index. php"/>
Value = "index.html"/>
Value = "Default.htm"/>
Value = "Default. asp"/>
Value = "index.htm"/>
Value = "Default. aspx"/>
Value = "index.shtml"/>



ResponseMode = "ExecuteURL"/>




If you only need to remove index. php, add the following code directly In the middle.

XML







Input = "{HTTP_HOST}" pattern = "^ (. *) $"/>
Input = "{REQUEST_FILENAME}" matchType = "IsFile" negate = "true"/>
Input = "{REQUEST_FILENAME}" matchType = "IsDirectory" negate = "true"/>

Type = "Rewrite" url = "index. php/{R: 1}"/>







Note that you must modify the config. php file of Codeigniter. The file is in the application/config directory by default.
The following content in this file:

PHP


// $ Config ['index _ page'] = "index. php"; Change "index. php" to "", as shown below:
$ Config ['index _ page'] = "";



Hope to help you with the shoes that want to remove "index. php" under IIS7.5... For details, refer:
IIS7.5 pseudo-static URL Rewrite Rules (Ci, codeigniter, eMlog, Discuz ...) Http://qfish.me/2011/05/iis7-5-url-rewrite.htmll

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.