If I want to redirect all requests to a single page showing "maintenance" I do the following in htaccess
RewriteCond %{REQUEST_URI} !/maintenance.html$ [NC]
RewriteCond %{REQUEST_URI} !\.(jpe?g?|png|gif) [NC]
RewriteRule .* /maintenance.html [R=307,L]
But if I want to hide /maintenance.html from url http://www.example.com/maintenance.html in the address bar how can I do?
It is not possible.
You can use:
RewriteCond %{REQUEST_URI} !\.(jpe?g?|png|gif) [NC]
RewriteRule !^maintenance\.html$ /maintenance.html [NC,L]
But in this case, there is no error code or redirection.
If you want a redirection, there is necessarily a change of url in the address bar.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.