我想重写此URL:
https://example.com/forms/cus_F8fylX6aITpJOR
到
https://example.com/assets/forms/redirect.php?id=cus_F8fylX6aITpJOR
这是我尝试过的:
RewriteCond %{QUERY_STRING} id=(\w+) [NC]
RewriteRule ^assets/forms/redirect.php?id=$1 [L]
我的错误在哪里?
感谢您的帮助。
答案 0 :(得分:1)
这是您需要的:
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^forms/([^/]+) /assets/forms/redirect.php?id=$1 [QSA,L]