2017-04-24 34 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

相關問題