RewriteCond %{SERVER_PORT} !^443$
RewriteRule MATCHME https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
如果MATCHME不在URL中,那么重写规则将不被处理吗?你能给我一些文件吗?
正确。如果模式MATCHME
不存在,则不进行重写。
如果您需要在RewriteCond
处于活动状态时匹配一个捕获所有规则,您可以指定一个额外的规则,如:
RewriteCond %{SERVER_PORT} !^443$
RewriteRule MATCHME https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
# Catch-all rule
RewriteRule ^(.*)$ https://%{SERVER_NAME}/someotherpage [L,R,QSA]
查看mod_rewrite文档