apache - what's the rewrite rule meaning? -
rewriteengine on      rewriterule ^(.*)$ http://$1 [r=301,l] what's meaning of line ( rewriterule ^(.*)$ http://$1 [r=301,l] ). thank you.
it's 301 (permanent) redirect whatever path on relative domain name:
http://<your website>.com/example.com redirect http://example.com.
rewriterule ^(.*)$ http://$1 [r=301,l]
it literally saying, "ok, found in folder should considered permanently redirected domain".
- ^(.*)$means select , call $1
- http://$1means go domain stored in $1
- r=301refers status code 301, "permanently moved" redirect.
- l means final instruction matching pattern. no other redirect rule after 1 effect these redirects.
Comments
Post a Comment