1
你好,我想一些動態URL重定向到一些靜態URL 如htaccess的動態網址重定向
- /folder/index.php?rid=321
到
- http://example.com/folder/some-name-321.htm
和
- /folder/index.php?rid=324
到
- HTTP://example.com/folder/some-other-name-324.htm
我試圖
Redirect 301 /folder/index.php?rid=321 http ://example.com/folder/some-name-321.htm
Redirect 301 /folder/index.php?rid=324 http ://example.com/folder/some-other-324.htm
但不工作。 我應該如何重定向這些網址 另外,我應該在哪裏放置我的htaccess文件。 這應該在/folder/.htaccess中,或者我應該將規則放在網站根目錄下的主htaccess文件中。
親切的問候
我想這一點,但無濟於事,嘗試此方法後,當我訪問/folder/index.php?rid=321忽略了最低重定向到http://example.com/folder/some-name-321.htm –
好吧,我用了下面的RewriteCond%{QUERY_STRING}(^ |&)rid = 325($ |&) RewriteRule^folder/index \。 php $ /folder/some-name-325.htm [L,R = 301] 但它重定向到http://example.com/folder/some-name-325.htm?rid=325 雖然我只需要http://example.com/folder/some-name-325.htm –