2013-11-04 48 views
0

我如何可以重定向我的網站從這個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的請。我無法添加代碼,以便粘貼它在引擎收錄

回答

0

啓用通過httpd.confmod_rewrite.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] 
+0

獲取內部服務器錯誤 – user2951768

+0

我錯過了右括號,現在檢查已編輯的代碼。 – anubhava

+0

現在404錯誤:P – user2951768

相關問題