Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google      Sign In   
  • Create Account

Subscribe to HRA Now!

 



Are you a Google Analytics enthusiast?

Share and download Custom Google Analytics Reports, dashboards and advanced segments--for FREE! 

 



 

 www.CustomReportSharing.com 

From the folks who brought you High Rankings!


Sponsored Content

 

 
 

Photo
- - - - -

301 Or Dns Redirect


  • Please log in to reply
4 replies to this topic

#1 assafi

assafi

    HR 3

  • Active Members
  • PipPipPip
  • 68 posts

Posted 11 November 2004 - 05:57 AM

Hi all,
I've noticed this topic has been very popular lately.
I am looking for your remarks on my situation and the way I handled it.
My client has two different main sites for our company: www.MyDomain1.com and www.MyDomain2.com
Mydomain1.com has Google PR=1
Mydomain2.com has Google PR=5.

For technical issues we have decided to update Mydomain1 and redirect Mydomain2.com to 1 .

inorder to redirect I've added the following header to MyDomain2.com/index.asp :
Redirect 301 * h ttp://www.MyDomain1.com

is this enough to redirect any hit or inbound link to our new update MyDomain1.com?
Will this redirwect users from all MyDomain2.com Pages or only from index.asp?
Was I better off updating MyDomain2 current DNS to Mydomain1.com IP Address?

I have obviously two main goals:
1. Make sure the users who visit MyDomain2.com will see the contents (and will be redirected) to the updated MyDomain1.com.
2. To preserve Google PR for MYDomain2.com and have it updated to MyDomain1.com's PR.

Thanks,
Assaf.

#2 Randy

Randy

    Convert Me!

  • Moderator
  • 17,540 posts

Posted 11 November 2004 - 06:12 AM

To make sure I'm understanding your question, you've added the redirect to the index.asp file itself, correct?

If so, only visits to that particular page are going to be redirected. Visits to any other page of the site will not redirect.

If you want to redirect all traffic to any page on the entire domain you'll have to do it at the server level, or place redirect code in each page that currently exists.

The pinned thread above has the ways to do that for both *nix servers (.htaccess) and Windows servers.

#3 chrishirst

chrishirst

    A not so moderate moderator.

  • Moderator
  • 5,881 posts
  • Location:Blackpool UK

Posted 11 November 2004 - 06:53 AM

actually you need this code in the index/default.asp
CODE
<%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location", "http://www.domain.com/"
response.end
%>

as in the pinned thread at the top of the forum.

the code you posted is for the .htaccess (Apache only)

if you want to redirect every page in one domain to the same pagename in another domain use this. This also makes www the default.
ASP vbScript
CODE
<%
dim hostname
dim pathinfo
dim bRedirect
dim MainDomain

MainDomain = "www.mydomain.com"
hostname = request.servervariables("HTTP_HOST")
pathinfo = request.servervariables("PATH_INFO")

if pathinfo <> "" then
    if instr(lcase(pathinfo),"default.asp") > 0 or instr(lcase(pathinfo),"index.asp") > 0 then
     MainDomain = MainDomain & "/" & mid(pathinfo,2,instrrev(pathinfo,"/")-1)
    else
 MainDomain = MainDomain & pathinfo
    end if
else
     MainDomain = MainDomain & "/"
end if
if left(hostname,instr(hostname,".")) <> "www." then bRedirect = true
if instr(hostname, "domain2") > 0 then bRedirect = true
if bRedirect then
    response.status = "301 Moved Permanently"
    response.addheader "Location", "http://" & MainDomain
    response.end
end if
%>

I normally put the code into an included file with every page.
It will work for redirecting subdomains and parked or aliased hostnames and also makes sure that the index page will not appear in the URL for subfolders.

#4 assafi

assafi

    HR 3

  • Active Members
  • PipPipPip
  • 68 posts

Posted 11 November 2004 - 11:08 AM

Thanks for the detailed information.

I was just wondering.
Our programmer suggested to make the change on our IIS settings.
So every link which directs to www.Mydomain2.com will redirect to MyDomain1.com .

We want every attempt to reach any page on MyDomain2 to redirect to MyDomain1.com/Default.asp

Randy, is this what you ment by taking care of the redirect in the server level?
Does the IIS redirect method preserves Google PR and other SEO specific concerns?

Thanks,
Assaf.

#5 chrishirst

chrishirst

    A not so moderate moderator.

  • Moderator
  • 5,881 posts
  • Location:Blackpool UK

Posted 11 November 2004 - 12:36 PM

Yes you can do the same in IIS.
You will need two sites pointing to the same folders. One with a hostheader for the primary hostname (www.domain.com) the the second site with hostheaders for domain.com, www.domain2.com and domain2.com. plus any other DNS alias/pointers you have set up.

Then because there are SE indexed pages, you need to set permanent redirects for every individual document in the site not just at the top level, otherwise all access to other pages in the other domains will be directed to the site root and rankings/PR etc for those pages that are indexed will be lost.
This cannot be done with one virtual host and hostheaders.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users