Archive for htaccess

Redirect all pages to one single page for maintenance with htaccess

If your website is down for maintenance or if you have problems with host provide you may want to redirect all requests to a single page.we could do this by adding some codes into .htaccess file which exist in root.

here is the code,just add in bottom of .htaccess file modify the URL to your desire:

RewriteEngine On
 RewriteBase /
 RewriteCond %{REQUEST_URI} !^/redirect\.html$
 RewriteRule ^(.*)$ [R=307,L]


How to tell search engines if page has been moved

If you ever want to restructure your site, one of the biggest issue is the already established inlinks and search engine rankings. You do not want to lose those, under any circumstances, but this does not mean you cannot move your pages.

When a user requests a page, their browser sends the request to your server. Your server will return a status code – this status code is 200 for a normal page. You may have also heard of 404, used for a non-existant page. You can redirect your users with a 302 redirect – this is a temporarily moved page, or a 301 redirect – a permanently moved page.

Read more