301 Redirect is a technique in which we redirect one url to another url. Some time we we delete a page of website and create new [age for the website for any reason and upload this on server but we see that the old page(that is deleted) ranked on search engine 301 redirect is helped us for use this traffic for new page.
301 redirect is help for change address as you want to make sure all your mail is forwarded to your new place.
To solve these kind of problem we use 301 redirect, we create .htaccess file and save it on the server.
htaccess code for html:
RewriteEngine On
Redirect 301 www.xyz/old.html http://www.xyz.com/new.html
Redirect whole domain :
Incase you want to change your domain name, you can safely redirect users to new site using following codes.
Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^domain.com [nc]
rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]
Dynamic pages redirect to static pages:
.htaccess code below will convert dynamic PHP pages, view.php?id=xyz to pagewxyz.html
RewriteEngine On
RewriteRule ^page_([^/.]+).html$ view.php?id=$1 [L]
So Create an htaccess file and upload this on server.
.jpg)

.jpg)
No comments:
Post a Comment