1 / 3
Caption Text
2 / 3
Caption Two
3 / 3
Caption Three margin testing

Thursday, January 14, 2010

Using 301 Page Redirects

Using 301 Page Redirects - GoDaddy Help Center, Search the GoDaddy Knowledge Base

If you renamed or moved pages of your website, a 301 redirect lets you automatically redirect visitors and search engine spiders to your new pages while maintaining your search engine ranking.

For example, you can redirect traffic from oldpage.php (.asp or .jsp) to "http://www.newdomain.com/newpage.html" and retain your search engine ranking and back links.

Use the code below to redirect traffic to your pages using a 301 Redirect.

NOTE: In the code examples below, replace "oldpagename" with the name of your old Web page from which you want to redirect traffic and replace "newpage.html" with the name of the new Web page to which you want to redirect traffic.

PHP

Save this as oldpagename.php

<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.newdomain.com/newpage.html");
exit();
?>

ASP

Save this as oldpagename.asp

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

ASP.NET

Save this as oldpagename.aspx

<script language="c#" 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>

ColdFusion

Save this as oldpagename.cfm

<.cfheader statuscode="301" statustext="Moved permanently">
<.cfheader name="Location" value="http://www.newdomain.com/newpage.html">

.htaccess

When using a Linux server with the Apache Mod-Rewrite module enabled, you can create a .htaccess file to ensure that all requests to coolexample.com will redirect to www.coolexample.com, where "coolexample.com" is your domain. Save the .htaccess file in your old website's root directory, which is the same directory as your index file. You can create a .htaccess file with the following code:

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

Does an SSL Certificate Secure Both www.yourpersonaldomainname.com and yourpersonaldomainname.com

Does an SSL Certificate Secure Both www.yourpersonaldomainname.com and yourpersonaldomainname.com - GoDaddy Help Center, Search the GoDaddy Knowledge Base

Yes, an SSL certificate secures the common name (domain name) listed in the certificate, with or without the "WWW" prefix.

NOTE: In the case of UCC certificates or "Multiple Domain Certificates", only the primary domain name is secured both with and without www.

The Subject Alternative Names (SANs) do not receive the same treatment.

NOTE: Until renewed, certificates issued prior to December 2006 only secure the exact, fully-qualified domain entered as the common name in the Certificate Signing Request (CSR). Thus, a certificate that secures "www.yourpersonaldomainname" does not secure the "yourpersonaldomainname.com."

Featured Post

Windows和Ubuntu双系统完全独立的安装方法

http://www.ubuntuhome.com/windows-and-ubuntu-install.html  | Ubuntu Home Posted by Snow on 2012/06/25 安装Windows和Ubuntu双系统时,很多人喜欢先安装windows,然...