Rewrite / Redirect URI - Apache
Use PCRE to rewrite URL
!
: not match=
: match plain string
RewriteEngine { on | off }
RewriteCond "<test string>" "[!]<RegExp condition>" [<flags>]
RewriteCond "<test string>" "[!]=<string condition>" [<flags>]
RewriteRule "<RegExp pattern>" "<substitution>" [<flags>]
- By default, the query string is passed through unchanged
- To replace query string, append
?<query>
to<substitution>
- To combin original query string, use
[QSA]
flag
Redirect HTTP to HTTPS
RewriteEngine on
RewriteCond "%{HTTPS}" "=off"
RewriteRule "^/?(.*)" "https://%{HTTP_HOST}/$1" [R,L]
Debug
LogLevel alert rewrite:trace3