htAccess 从一个链接重写到另一个链接相同的目录



如何从这里重定向我的网站

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 中

启用mod_rewrite并通过httpd.conf .htaccess(如果尚未启用),然后将以下代码放入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]

最新更新