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://$1 means go domain stored in $1
  • r=301 refers status code 301, "permanently moved" redirect.
  • l means final instruction matching pattern. no other redirect rule after 1 effect these redirects.

Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -