建站知识搜索
|
Thinkphp伪静态配置:.htaccess转成Web.Config3163次浏览 |
2016-06-29 |
|
Thinkphp伪静态配置:.htaccess转成Web.Config
其中.htaccess规则设置如下
<IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L] </IfModule>
如服务器转成了windows环境,可参考如下配置web.config
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="OrgPage" stopProcessing="true"> <match url="^(.*)$" /> <conditions logicalGrouping="MatchAll"> <add input="{HTTP_HOST}" pattern="^(.*)$" /> <add input="{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> </system.webServer>
</configuration> 可直接复制以上代码进行使用
页面所在本站地址: http://www.52-life.net/N_Thinkphp_Rurl.htm |
上一篇 >>为什么百度只收录了网站一个首页 |
下一篇 >>备案成功通知:温岭市柏达自动化科技有限公司网站备案进度一览 |
|
|
|