.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

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -