舊的URL是這樣的: http://mywebsite.com/index.php?mode=thread&id=284607如何使用參數重定向動態網址?
新的網址是: http://mywebsite.com/threads/284607
正如你所看到的,我想從舊的動態URL抓取編號,並將其指向新漂亮的網址。
我試過在這裏和其他地方找到解決方案,但不斷從重定向中刪除「mode = thread」部分的問題。
感謝您的幫助!
更新:下面是一些已經在.htaccess文件中的其他代碼。
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
謝謝你的快速響應!它現在重定向到:http://mywebsite.com/?mode=thread&id=284607 – Wendell
是的,這就是你想要的不是嗎? – xcvd
不,它需要去http://mywebsite.com/threads/284607 – Wendell