【发布时间】:2014-05-04 14:06:28
【问题描述】:
我使用 SMF 来运行我的论坛。
这是旧论坛网址 => hxxp://www.example.com/
但是现在,我将我的论坛移动到“论坛”文件夹 => hxxp://www.example.com/forum/
Google 和其他搜索引擎使用以下网址为我的网站编制索引:hxxp://www.example.com/index.php?topic=99.0
而当用户访问hxxp://www.example.com/index.php?topic=99.0时,却找不到。
因为他必须去hxxp://www.example.com/forum/index.php?topic=99.0,对吧?
所以,我想重定向 url 来自 hxxp://www.example.com/index.php?topic=99.0 转至 hxxp://www.example.com/forum/index.php?topic=99.0
我该怎么办?我试试这个,但不行。
RewriteEngine On
RewriteBase /
RewriteRule ^index.php?topic=([0-9]+).([0-9]+)$ forum/index.php?topic=$1.$2 [R]
【问题讨论】:
-
试试
^/index.php而不是^index.php
标签: php apache .htaccess mod-rewrite redirect