我一直在寻找这个,但.htaccess语法仍然是一种神秘的语言,我最终做了大量的猜测和检查。
我试图重写请求:
/folder/index.php?id = ... - > /folder/index-new.php?id = ...
我可以替换index.php,原因不值得解释。我希望每次请求index.php时都使用参数重定向到index-new.php。
答案 0 :(得分:0)
将此代码放入DOCUMENT_ROOT/.htaccess
文件中:
RewriteEngine On
RewriteRule ^(folder)/index\.php$ /$1/index-new.php [L,NC]
QUERY_STRRING
会自动转移到新网址。