如何将 myforum.com/index.php 永久重定向到 myforum.com
我在 IIS 7.5 上的 Windows Server 2008 上使用 MYBB php 论坛
我想将 index.php 永久重定向到主 url
我该怎么做?
示例
http://forum.monstermmorpg.com/index.php
将被重定向到
http://forum.monstermmorpg.com
我该怎么做?谢谢。
我正在使用的重写规则
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^([^&]*)&(.*)$" ignoreCase="false" />
<action type="Redirect" url="http://forum.monstermmorpg.com/{R:1}?{R:2}" appendQueryString="true" redirectType="Permanent" />
</rule>
<rule name="Imported Rule 2" stopProcessing="true">
<match url="^sitemap\-([^./]+)\.xml$" />
<action type="Rewrite" url="misc.php?google_seo_sitemap={R:1}" appendQueryString="true" />
</rule>
<rule name="Imported Rule 3" stopProcessing="true">
<match url="^Forum\-([^./]+)$" />
<action type="Rewrite" url="forumdisplay.php?google_seo_forum={R:1}" appendQueryString="true" />
</rule>
<rule name="Imported Rule 4" stopProcessing="true">
<match url="^Thread\-([^./]+)$" />
<action type="Rewrite" url="showthread.php?google_seo_thread={R:1}" appendQueryString="true" />
</rule>
<rule name="Imported Rule 5" stopProcessing="true">
<match url="^Announcement\-([^./]+)$" />
<action type="Rewrite" url="announcements.php?google_seo_announcement={R:1}" appendQueryString="true" />
</rule>
<rule name="Imported Rule 6" stopProcessing="true">
<match url="^User\-([^./]+)$" />
<action type="Rewrite" url="member.php?action=profile&google_seo_user={R:1}" appendQueryString="true" />
</rule>
<rule name="Imported Rule 7" stopProcessing="true">
<match url="^Calendar\-([^./]+)$" />
<action type="Rewrite" url="calendar.php?google_seo_calendar={R:1}" appendQueryString="true" />
</rule>
<rule name="Imported Rule 8" stopProcessing="true">
<match url="^Event\-([^./]+)$" />
<action type="Rewrite" url="calendar.php?action=event&google_seo_event={R:1}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
I am using MYBB php forum at windows server 2008 on IIS 7.5
I want to permanently redirect index.php to main url
How can i do that ?
Example
http://forum.monstermmorpg.com/index.php
Will be redirected to
http://forum.monstermmorpg.com
How can i do that ? Thank you.
The rewrite rules i am using
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^([^&]*)&(.*)$" ignoreCase="false" />
<action type="Redirect" url="http://forum.monstermmorpg.com/{R:1}?{R:2}" appendQueryString="true" redirectType="Permanent" />
</rule>
<rule name="Imported Rule 2" stopProcessing="true">
<match url="^sitemap\-([^./]+)\.xml$" />
<action type="Rewrite" url="misc.php?google_seo_sitemap={R:1}" appendQueryString="true" />
</rule>
<rule name="Imported Rule 3" stopProcessing="true">
<match url="^Forum\-([^./]+)$" />
<action type="Rewrite" url="forumdisplay.php?google_seo_forum={R:1}" appendQueryString="true" />
</rule>
<rule name="Imported Rule 4" stopProcessing="true">
<match url="^Thread\-([^./]+)$" />
<action type="Rewrite" url="showthread.php?google_seo_thread={R:1}" appendQueryString="true" />
</rule>
<rule name="Imported Rule 5" stopProcessing="true">
<match url="^Announcement\-([^./]+)$" />
<action type="Rewrite" url="announcements.php?google_seo_announcement={R:1}" appendQueryString="true" />
</rule>
<rule name="Imported Rule 6" stopProcessing="true">
<match url="^User\-([^./]+)$" />
<action type="Rewrite" url="member.php?action=profile&google_seo_user={R:1}" appendQueryString="true" />
</rule>
<rule name="Imported Rule 7" stopProcessing="true">
<match url="^Calendar\-([^./]+)$" />
<action type="Rewrite" url="calendar.php?google_seo_calendar={R:1}" appendQueryString="true" />
</rule>
<rule name="Imported Rule 8" stopProcessing="true">
<match url="^Event\-([^./]+)$" />
<action type="Rewrite" url="calendar.php?action=event&google_seo_event={R:1}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您使用 web.config 文件并安装了 IIS 重写模块,则此规则应该有效
If your using a web.config file and have the IIS Rewrite Module installed, this rule should work
在index.php上写下这样的内容:
On index.php write something like this: