How to 301 Redirect .htaccess

How to implement 301 redirect through .htaccess file - Sometimes we search engine Optimizers want to redirect our visitors to different pages of websites for some reasons at the time of website optimization such as webpages moved to another Locations or renamed for Search engine Optimization reasons, or no longer exists on the server means removed - error 404. Here comes the role of redirects, and the only solution to this issue is to redirect the page.

There are basically two ethical and right ways to redirect for the Linux platform and PHP. The first is editing your .htaccess and the other less popular way is through adding a code to your webpage header.

If You want to redirect one webpage to a new webpage on your website. You can do this very simply by using one of these to methods.

Editing  Dot htaccess File :

To do this, you will have have to add the following CODES  into the dot htaccess file.

RewriteEngine on

RewriteCond %{HTTP_HOST} ^your-domain\.com [NC]
RewriteRule (.*) http://www.your-domain.com/$1 [L,R=301]

If the RewriteEngine on is not declared in the .htaccess file, you will have to declare it.

More Resources:

SEO company that can helps you understand what the best SEO practices are and how to implement them on and off your website.

No comments:

Post a Comment