Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想重定向domain.com/folder1/nisanth.php?id=1到domain.com/folder2/nisanth.php?id=1. 我怎样才能写我的 htaccess 行?我尝试使用
domain.com/folder1/nisanth.php?id=1
domain.com/folder2/nisanth.php?id=1
Redirect 301 /folder1/nisanth.php?id=$1 /folder2/nisanth.php?id=$1
但没有用。
这应该可以帮助你
RewriteEngine on RewriteRule ^/folder1/nisanth.php?id=(.*)$ /folder2/nisanth.php?id=$1 [L,R=301]
应该
Redirect 301 /folder1/nisanth.php?id=(.*) http://www.domain.com/folder2/nisanth.php?id=$1