Redirect all request to a specific page

Sometimes a site may go under maintainance or for a newly bought domain, you may need to redirect any request to your site to a specific page, it can be done by htaccess beside some other methods.

Your server must have the mod rewrite module on to make the following code working. Put the following code inside your htaccess file.

RewriteEngine on
RewriteCond %{REQUEST_URI} !(/maintenance.html$ 
RewriteRule $ /maintenance.html [R=302,L]

It’s really helpfull

This entry was posted in Uncategorized and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.