我的。htaccess文件都在本地主机上工作。我有没有让网站上线,然后那里htaccess不工作。我的服务器是Windows服务器而不是linux服务器
我已经使用这个网站的htaccess到web配置转换器htaccess到webconfig链接
。访问代码
RewriteEngine on
RewriteRule ^index.html$ index.php [NC,QSA]
RewriteRule ^enquiry.html$ enquiry.php [NC,QSA]
Web配置代码
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<rule name="rule 1o">
<match url="^index.html$" ignoreCase="true" />
<action type="Rewrite" url="/index.php" appendQueryString="true" />
</rule>
<rule name="rule 2o">
<match url="^enquiry.html$" ignoreCase="true" />
<action type="Rewrite" url="enquiry.php" appendQueryString="true" />
</rule>
</system.web>
</configuration>
我有自己的解决方案,因为我的IIS 7正在帮助我解决这个问题,
你可以使用配置和重写所有的规则集在规则中然后你得到答案为htaccess是工作在webconfig
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="MyRule">
<match url="index.html" />
<action type="Rewrite" url="/index.php" appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>