http error 301 moved permanently with .htaccess in php

Some time when we transfer or redirect some of our website page to other URL, we face an error http 301 moved permanently error in php. its means our search engine does not find the specified URL so it throws http 301 – moved permanently error on the screen. A page redirect with 301 permanent tells the search engines that new URL has taken place of old URL permanently. So search engines will remove old urls from there indexes.

Here’s the ways, we can redirect from one file to another file.

if you want to redirect page from to

Redirect Site to WWW URL

Use this setting if you want to keep your site always running www URL. This also helpful for SEO.

Redirect Site to Non WWW URL

If you want to keep your site to run always without www URL. This has there own pros and cons. Like using cookies on site.

Redirect Entire Site to New Domain

Ever you want to change your website domain, you can easily redirect all pages from old url to new url.

Or you can use following settings.


Print Friendly

Leave a Reply

Your email address will not be published. Required fields are marked *