Make Money Online Queries? Struggling To Get Traffic To Your Blog? Sign Up On (HBB) Forum Now!

HOW TO: Create 301 URL Redirection

CONNECT WITH HBB ON SOCIAL MEDIA

URL redirection is also called URL forwarding, URL shortener, domain redirection and domain forwarding.

Why to redirect a website?

For Similar Domain Names :

301 RedirectionA user accessing a particular domain name may type the wrong spelling of it. For example, consider www.hellboundbloggers.com and www.helboundbloggers.com. Here one ‘l’ is missing in the second domain name. Organizations often register these mis-spelled and redirect them to the correct domain name. Another example is redirecting domains for reserving TLDs (Top Level Domains). The addresses hellboundbloggers.com and hellboundbloggers.net could both redirect to a single domain, such as hellboundbloggers.org.

MUST READ : Introduction To HTACCESS For Newbies

Moving a website to a new domain :

A webpage or website can be redirected for many reasons like the website might need to change its domain name or the author of that website might move his or her pages to a new domain.

HTTP Status codes for redirect :

  • 300 Multiple ChoicesΒ  (like offering different languages)
  • 301 Moved Permanently
  • 302 Found (like temporary redirect)
  • 303 See Other (For results of CGI-Scripts)
  • 307 Temporary Redirect

Common Methods for Redirecting A Website [URL Redirection]

Open Notepad or any other editor and copy the required code and save it. Then upload that file to your directory. I made use of the PHP redirect for redirecting My Mobile Site to Google Reader. I made mobile version of my blog through Google Reader.

READ
List Of U.S. Government Agencies Using WordPress

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" );
%>


.htaccess Redirect

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


CGI PERL Redirect


$q = new CGI;
print $q-&amp;gt;redirect(&amp;quot;http://www.new-url.com/&amp;quot;);


Ruby on Rails Redirect

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


HTML Redirect

Place the following HTML code between the <HEAD> and </HEAD> tags of your HTML code.

<meta HTTP-EQUIV="REFRESH" content="0; url=http://www.yoursite.com/">



By

CEO and Founder of Slashsquare, Indian Blog Network and Web Consulting Media. HBB is a part of Slashsquare Network. I'm a Tech Blogger, Striving Entrepreneur, Atheist, and Proud Indian. Catch me on Facebook and Twitter.

  • My Website

Want to discuss your queries and interact with experts? You can connect with HellBound Bloggers (HBB) Facebook group for free!

Join HellBound Bloggers (HBB) and get Instant Updates. We'll also notify you with Great Deals, Discounts and other Interesting Tips. We won't SPAM or SHARE your Email Address with anyone.

Thank you for reading! We welcome and appreciate your comments, but at the same time, make sure you are adding something valuable to this article. If you have any serious queries, suggestions or anything related to this article, feel free to share them, we really appreciate that.

But, if your blog comments are a random "Thank you", "Useful Post", or anything that doesn't actually upscale the article, then we'll be removing them and it won't be appeared below. Thanks for understanding and thanks for connecting with us. If you want to give us any feedback or report any errors, you can kindly contact us and we'll revert back soon.

  • Comments
  • Facebook Comments