如何从此
重定向我的网站http://www.mysite.org/forum/posts/129731/
到
http://www.mysite.org/forum/showthread.php?p=129731
和
http://www.mysite.org/forum/threads/hey-yall.12875
到
http://www.mysite.org/forum/showthread.php?t=12875
感谢
编辑:
http://pastebin.com/La5Vf5vH
添加htaccess请检查。我无法添加粘贴在pastebin中的代码
答案 0 :(得分:0)
启用mod_rewrite
和.htaccess
至httpd.conf
(如果尚未启用),然后将此代码放入DOCUMENT_ROOT/.htaccess
文件中:
RewriteEngine On
RewriteRule ^(forum)/posts/([0-9]+)/?$ /$1/showthread.php?p=$2 [L,QSA,NC]
RewriteRule ^(forum)/threads/(?:[^.]+\.)?([0-9]+)/?$ /$1/showthread.php?t=$2 [L,QSA,NC]