.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

angular ui router - 10 digest iterations reached in angularjs when using $state.go -

symfony - InvalidConfigurationException in SecurityExtension.php line 429: No authentication listener registered for firewall "secured_area" -

javascript - Can Piwik report referrer in real time? -