您的位置:首页 > 运维架构 > Apache

thinkphp5.0在开启重定向,空间iis7.5下配置web.config和apache下配置.htaccess

2017-11-03 14:59 507 查看
有疑问的可以加群162092974咨询

根目录下的web.config文件

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<remove name="PHP-7.0-7i24.com" />
<remove name="PHP-5.6-7i24.com" />
<remove name="PHP-5.5-7i24.com" />
<remove name="PHP-5.4-7i24.com" />
<remove name="PHP-5.3-7i24.com" />
<remove name="PHP-5.2-7i24.com" />
<add name="PHP-5.5-7i24.com" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="c:\php\5.5\php-cgi.exe" resourceType="Either" />
</handlers>
<rewrite>
<rules>
<rule name="已导入的规则 1" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php/{R:1}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>


根目录下的.htaccess

<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: