Webmaster Forum

Webmaster Forum Home Webmaster Tools Classified Ads

Go Back   Webmaster Forum > Marketing > Search Engine Optimization

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-15-2008, 08:14 AM
micoblanco's Avatar
Junior
 
Join Date: Nov 2008
Posts: 274
iTrader: (0)
Thanks: 8
Thanked 18 Times in 11 Posts
micoblanco will become famous soon enoughmicoblanco will become famous soon enough
Question How to...

Guys I want to know how to set up a permanent redirect (technically called a "301 redirect")?

Thanks!
__________________
Reply With Quote
  #2 (permalink)  
Old 12-15-2008, 08:26 AM
mit's Avatar
mit mit is online now
Master
 
Join Date: Apr 2008
Gender: Male
Location: India
Posts: 7,498
iTrader: (0)
Thanks: 142
Thanked 412 Times in 357 Posts
mit is a splendid one to beholdmit is a splendid one to beholdmit is a splendid one to beholdmit is a splendid one to beholdmit is a splendid one to beholdmit is a splendid one to beholdmit is a splendid one to behold
Send a message via Yahoo to mit
Default

301 Redirect

301 redirect is the most efficient and Search Engine Friendly method for webpage redirection. It's not that hard to implement and it should preserve your search engine rankings for that particular page. If you have to change file names or move pages around, it's the safest option. The code "301" is interpreted as "moved permanently".

You can Test your redirection with Search Engine Friendly Redirect Checker

Below are a Couple of methods to implement URL Redirection

IIS Redirect

* In internet services manager, right click on the file or folder you wish to redirect
* Select the radio titled "a redirection to a URL".
* Enter the redirection page
* Check "The exact url entered above" and the "A permanent redirection for this resource"
* Click on 'Apply'

ColdFusion Redirect
<.cfheader statuscode="301" statustext="Moved permanently">
<.cfheader name="Location" value="http://www.new-url.com">

PHP Redirect
<?
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.new-url.com" );
?>

ASP Redirect

<%@ Language=VBScript %>
<%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location","http://www.new-url.com/"
%>

ASP .NET Redirect
<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location","http://www.new-url.com");
}
</script>

JSP (Java) Redirect
<%
response.setStatus(301);
response.setHeader( "Location", "http://www.new-url.com/" );
response.setHeader( "Connection", "close" );
%>

CGI PERL Redirect
$q = new CGI;
print $q->redirect("http://www.new-url.com/");

Ruby on Rails Redirect
def old_action
headers["Status"] = "301 Moved Permanently"
redirect_to "http://www.new-url.com/"
end

Redirect Old domain to New domain (htaccess redirect)

Create a .htaccess file with the below code, it will ensure that all your directories and pages of your old domain will get correctly redirected to your new domain.
The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]

Please REPLACE www.newdomain.com in the above code with your actual domain name.

In addition to the redirect I would suggest that you contact every backlinking site to modify their backlink to point to your new website.

Note* This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.

Redirect to www (htaccess redirect)

Create a .htaccess file with the below code, it will ensure that all requests coming in to domain.com will get redirected to www.domain.com
The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^domain.com [nc]
rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]

Please REPLACE domain.com and www.newdomain.com with your actual domain name.

Note* This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.

How to Redirect HTML
Please refer to section titled 'How to Redirect with htaccess', if your site is hosted on a Linux Server and 'IIS Redirect', if your site is hosted on a Windows Server.

Source - Webconfs
Reply With Quote
  #3 (permalink)  
Old 12-15-2008, 08:40 AM
micoblanco's Avatar
Junior
 
Join Date: Nov 2008
Posts: 274
iTrader: (0)
Thanks: 8
Thanked 18 Times in 11 Posts
micoblanco will become famous soon enoughmicoblanco will become famous soon enough
Default

To mit:

Thanks a lot. I'm going to study your given information. Thanks a lot. By the way... if I'm going to use 301 in a blog.. which one will be the best for me to use? (based on your post)
__________________
Reply With Quote
  #4 (permalink)  
Old 12-15-2008, 08:48 AM
micoblanco's Avatar
Junior
 
Join Date: Nov 2008
Posts: 274
iTrader: (0)
Thanks: 8
Thanked 18 Times in 11 Posts
micoblanco will become famous soon enoughmicoblanco will become famous soon enough
Default

P.S.

(just an example) If I'm going to use 301 redirect in the following urls.
http[colon]//www.p0h3k.blospot.com
p0h3k.blogspot.com

Can you suggest me what's the best way to use 310 redirect in the above urls. Thank you so much!
__________________
Reply With Quote
  #5 (permalink)  
Old 12-15-2008, 12:26 PM
manik's Avatar
Om Shanti!
 
Join Date: Apr 2008
Gender: Male
Location: Cambridge, MA
Posts: 10,663
iTrader: (4)
Thanks: 622
Thanked 527 Times in 448 Posts
manik is just really nicemanik is just really nicemanik is just really nicemanik is just really nice
Default

Quote:
Originally Posted by micoblanco View Post
P.S.

(just an example) If I'm going to use 301 redirect in the following urls.
http[colon]//www.p0h3k.blospot.com
p0h3k.blogspot.com

Can you suggest me what's the best way to use 310 redirect in the above urls. Thank you so much!
Your case is little different. Here is a good tutorial you can look at 301 permanent redirect, blogger beta, redirect blogger posts | TechCounter - TechNews, Money & SEO
Reply With Quote
  #6 (permalink)  
Old 12-16-2008, 12:52 AM
pawan's Avatar
Master
 
Join Date: May 2008
Posts: 2,681
iTrader: (0)
Thanks: 32
Thanked 54 Times in 43 Posts
pawan will become famous soon enoughpawan will become famous soon enough
Default

Quote:
Originally Posted by mit View Post
301 Redirect

301 redirect is the most efficient and Search Engine Friendly method for webpage redirection. It's not that hard to implement and it should preserve your search engine rankings for that particular page. If you have to change file names or move pages around, it's the safest option. The code "301" is interpreted as "moved permanently".

You can Test your redirection with Search Engine Friendly Redirect Checker

Below are a Couple of methods to implement URL Redirection

IIS Redirect

* In internet services manager, right click on the file or folder you wish to redirect
* Select the radio titled "a redirection to a URL".
* Enter the redirection page
* Check "The exact url entered above" and the "A permanent redirection for this resource"
* Click on 'Apply'

ColdFusion Redirect
<.cfheader statuscode="301" statustext="Moved permanently">
<.cfheader name="Location" value="http://www.new-url.com">

PHP Redirect
<?
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.new-url.com" );
?>

ASP Redirect

<%@ Language=VBScript %>
<%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location","http://www.new-url.com/"
%>

ASP .NET Redirect
<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location","http://www.new-url.com");
}
</script>

JSP (Java) Redirect
<%
response.setStatus(301);
response.setHeader( "Location", "http://www.new-url.com/" );
response.setHeader( "Connection", "close" );
%>

CGI PERL Redirect
$q = new CGI;
print $q->redirect("http://www.new-url.com/");

Ruby on Rails Redirect
def old_action
headers["Status"] = "301 Moved Permanently"
redirect_to "http://www.new-url.com/"
end

Redirect Old domain to New domain (htaccess redirect)

Create a .htaccess file with the below code, it will ensure that all your directories and pages of your old domain will get correctly redirected to your new domain.
The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]

Please REPLACE www.newdomain.com in the above code with your actual domain name.

In addition to the redirect I would suggest that you contact every backlinking site to modify their backlink to point to your new website.

Note* This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.

Redirect to www (htaccess redirect)

Create a .htaccess file with the below code, it will ensure that all requests coming in to domain.com will get redirected to www.domain.com
The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^domain.com [nc]
rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]

Please REPLACE domain.com and www.newdomain.com with your actual domain name.

Note* This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.

How to Redirect HTML
Please refer to section titled 'How to Redirect with htaccess', if your site is hosted on a Linux Server and 'IIS Redirect', if your site is hosted on a Windows Server.

Source - Webconfs
You explained it completely with very sensible way now many members understand it clearly.
__________________
SEO Company | Peru Tours | Pizza
Reply With Quote
  #7 (permalink)  
Old 12-16-2008, 01:31 AM
Sophomore
 
Join Date: Jul 2008
Posts: 139
iTrader: (0)
Thanks: 0
Thanked 15 Times in 14 Posts
rapidvectorseo will become famous soon enoughrapidvectorseo will become famous soon enough
Default

Quote:
Originally Posted by mit View Post
Source - Webconfs
This is good resource.
But you shouldn't post this entire information here.
You just need to give link to the original post.
301 Redirect - How to create Redirects
Because it may generate content duplication issue for webconfos and you people too. At least you should give a link to their page.
Some times it may require few days of time to create a extra ordinary content for the website but it only takes few minutes to copy and paste content of others...
I hope you'll agree with me.
Reply With Quote
Reply

Bookmarks

Tags
301 redirect, rediret code

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



 
 
- Advertise here

All times are GMT -4. The time now is 10:52 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
Ad Management plugin by RedTyger