我无法解决这个问题:
这是原始网址格式:
所有人都应该重定向到/支持
我从以下.htaccess代码开始,但不幸的是我最终得到了错误的网址。
RewriteCond %{QUERY_STRING} !=""
RewriteCond %{QUERY_STRING} !page=supportcp
RewriteRule ^index.php /support/ [R,L]
结果:/ support /?/ support /(错误)
非常感谢帮助!
答案 0 :(得分:1)
您需要在目标URI中附加?
以删除任何查询字符串:
RewriteEngine On
RewriteBase /
# Removes index.php from ExpressionEngine URLs
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteCond %{REQUEST_URI} !/system/.* [NC]
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]
RewriteCond %{THE_REQUEST} /index\.php [NC]
RewriteCond %{QUERY_STRING} !=""
RewriteCond %{QUERY_STRING} !page=supportcp
RewriteRule ^index\.php$ /support/? [R,NC,L]
# Directs all EE web requests through the site index file
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]