0
嗨,朋友。我正在用重写规则创建一个.htaccess文件。它在本地主机上运行良好,但在实时服务器上无法正常工作。我的主机使用Window服务器。重写规则不能在IIS中使用PHP服务器
我在.htaccess文件写了这个规则:
RewriteEngine On
RewriteBase /project_name/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !example.php
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule (.*) pages.php?page_slug=$1 [L]
'.htaccess'是Apache httpd专有的文件。 IIS使用不同的方法。看看[this](http://www.iis.net/downloads/microsoft/url-rewrite)以及其他链接的页面。 – Lukas 2013-05-09 17:11:19
您需要将这些规则写入网站根目录下的web.config文件中(假设您的主机具有可用的模块)。 – cheesemacfly 2013-05-10 20:22:52