2017-04-24 67 views

回答

2

Hta访问不会在Windows Live服务器工作,你必须修改根文件夹中的web.config文件你的项目,并在这样的部分下添加重写代码。肯定它会帮助你。

<?xml version="1.0" encoding="UTF-8"?> 
<configuration> 
    <system.webServer> 
     <rewrite> 
      <rules> 
      <rule name="Rule" stopProcessing="true"> 
       <match url="^(.*)$" ignoreCase="false" /> 
       <conditions> 
       <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" /> 
       <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" /> 
       <add input="{URL}" pattern="^/favicon.ico$" ignoreCase="false" negate="true" /> 
       </conditions> 
       <action type="Rewrite" url="index.php/{R:1}" appendQueryString="true" /> 
      </rule> 
      </rules> 
     </rewrite> 
     <directoryBrowse enabled="true" /> 
     <defaultDocument> 
      <files> 
       <clear /> 
       <add value="Default.htm" /> 
       <add value="Default.asp" /> 
       <add value="index.htm" /> 
       <add value="Default.aspx" /> 
       <add value="index.php" /> 
       <add value="index.html" /> 
       <add value="index.pl" /> 
       <add value="default.html" /> 
       <add value="Default.cshtml" /> 
      </files> 
     </defaultDocument> 
     <httpProtocol> 
      <customHeaders> 
       <clear /> 
      </customHeaders> 
     </httpProtocol> 

    </system.webServer> 
</configuration> 
1

我有类似的问题。将此文件放在根目录下的.htaccess文件中。这解决了我的问题。

RewriteEngine on 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteCond $1 !^(index\.php|images|robots\.txt) 
RewriteRule ^(.*)$ index.php?/$1 [L] 
+0

谢谢chika johnson – SRJ