0
我迁移Apache服务器到IIS服务器PHP扩展。IIS的URL
目前,在Apache服务器,如果我们有一个名为PHP页面www.example.com/test.php,我们可以访问它,即使没有最后的 “.PHP”(即WWW .example.com/test)。
如何实现IIS中的类似的行为?
我迁移Apache服务器到IIS服务器PHP扩展。IIS的URL
目前,在Apache服务器,如果我们有一个名为PHP页面www.example.com/test.php,我们可以访问它,即使没有最后的 “.PHP”(即WWW .example.com/test)。
如何实现IIS中的类似的行为?
随着IIS8及以上微软实施的网络平台,你可以下载的模块URL重写从那里(或只是从their site下载)。
之后,转到IIS服务管理,并点击“URL重写”
在右侧面板中,你会看到一个选项“导入规则。”
选择你.htaccess
(你现在有你的public_html
),然后点击“导入”按钮。
这将创建一个在您的网站内容的路径称为web.config
文件,将看起来像follwing:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Redirect index.php" stopProcessing="true">
<match url="index\.php/(.*)" />
<action type="Redirect" url="{R:1}" appendQueryString="false" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
也有一些在线服务,可能你的.htaccess
转换为web.config
尽管我尝试了一些,并从IIS服务管理导入更好地工作。
看看[this](http://www.iis.net/learn/extensions/url-rewrite-module/creating-rewrite-rules-for-the-url-rewrite-module)。 – Andrew
IIS确实有URL重写模块。你可以从微软下载 – frz3993
能否请您给我如何配置我的具体作用的暗示? – Spotlight