There are a lot of tutorials and code to get rid of index.php in the forum, but the tragedy is that you can configure the server,
And the server is either Apache or IIS 6-...
There is no IIS7.5 under how to configure.
I think we should have a lot of space provided by the service providers, some files can not be modified.
Once in the group saw a person arguing with the service provider garbage, do not let him modify the httpd.conf file,
Say what you let me change I can pseudo-static ... Also said server garbage, does not support URL rwrite.
In fact, IIS7.5 is supported, and the degree of configuration and flexibility is quite high,
As long as the configuration of the Web. config you know, you can completely disregard the service provider, this you know ...
What 404,500etc. filtering files, restricting access and so on are not a thing.
From this point of view, a lot of people because of the web. config does not understand, as well as to see the tutorial of the blind Worship, will make the above embarrassment.
Do not say, directly on the code:
Web. config
XML Replication Code
<?xmlversion="1.0"encoding="UTF-8"?>
<configuration>
<system.webserver>
<directorybrowseEnabled="False"/>
<rewrite>
<rules>
<ruleName="Orgpage"stopprocessing="True">
<matchUrl="^(.*)$"/>
<conditionslogicalgrouping="MatchAll">
<addinput="{Http_host}"pattern="^(.*)$"/>
<addinput="{Request_filename}"Matchtype="Isfile"Negate="True"/>
<addinput="{Request_filename}"Matchtype="Isdirectory"Negate="True"/>
</conditions>
<actionType="Rewrite"Url="Index.php/{r:1}"/>
</rule>
</rules>
</rewrite>
<defaultdocument>
<files>
<clear/>
<addValue="Index.asp"/>
<addValue="Index.aspx"/>
<addValue="Index.php"/>
<addValue="Index.html"/>
<addValue="Default.htm"/>
<addValue="Default.asp"/>
<addValue="Index.htm"/>
<addValue="Default.aspx"/>
<addValue="Index.shtml"/>
</files>
</defaultdocument>
>
<errorStatuscode="500"Substatuscode="1"Prefixlanguagefilepath=""Path="Www.QFisH.net"
responsemode= "Executeurl" />
<error statuscode= "404" substatuscode= "1" Prefixlanguagefilepath= " path=" qfish.me " responsemode= "Redirect" />
>
< Span class= "SC3" ></system.webserver>
</configuration>
Copy Code
If you just need to remove index.php, then add the following code directly to <system.webServer> </system.webServer> Center.
XML Replication Code
<rewrite>
<rules>
<ruleName="Orgpage"stopprocessing="True">
<matchUrl="^(.*)$"/>
<conditionslogicalgrouping="MatchAll">
<addinput="{Http_host}"pattern="^(.*)$"/>
<addinput="{Request_filename}"Matchtype="Isfile"Negate="True"/>
<add input="{request_filename}" matchtype="isdirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php/{r:1}" />
</rule>
</rules>
</rewrite>
Copy Code
Note that you also need to modify the config.php file for the settings CodeIgniter, which is default in the application/config directory.
The following content in this file:
PHP Copy Code
//$config [' index_page '] = "index.php"; Change the "index.php" to "", as follows:
$config[' Index_page '] = "";
Copy Code
Hope to help some want to IIS7.5 under the "index.php" of the same shoes ... With detailed can see:
IIS7.5 pseudo-static URL rewrite rule (ci,codeigniter,emlog,discuz ...) Http://qfish.me/2011/05/iis7-5-url-rewrite.htmll
IIS7.5 removing the index.php Web. config configuration file