.htaccess - htaccess maintenance mode with relative url -


i using following in .htaccess place site in maintenance mode:

################################################## rewriteengine on rewritebase / rewritecond %{remote_addr} !^11\.111\.111\.111 rewritecond %{request_uri} !^/maintenance\.html$ rewriterule ^(.*)$ http://domain.com/maintenance.html [r=307,l] ################################################## 

my question how make relative rather absolute, don't need http://domain.com part?

thanks!

i specify location of maintenance.html relative root without having include domain. have single .htaccess file can drop project without having change it

perhaps, use http_host variable don't have hardcoded domain.

rewriteengine on rewritebase / rewritecond %{remote_addr} !^11\.111\.111\.111 rewritecond %{request_uri} !^/maintenance\.html$ rewriterule ^(.*)$ http://%{http_host}/maintenance.html [r=307,l] 

Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

python - build a suggestions list using fuzzywuzzy -