View Full Version : 301 Redirect Check
ptpnewmedia
06-20-2005, 03:58 PM
Hey ya'll. I wanted to see if ya'll can verify that I did my 301 Redirects correclty. Here is the background to help.
Before we started consulting them, original web site was dowcompany.com. We then included www.dowcompany.com.
For SEO purposes we are now using dowfence.com and www.dowfence.com. So we do not get penalized for dupe content, we redirected the following to www.dowfence.com/default2.asp.
dowcompany.com
www.dowcompany.com
dowfence.com
www.dowfence.com
Can ya'll check this out to verify it was done correctly as this was the first time to do a 301 Redirect. Thanks so much.
Hi,
I'm not sure I agree it would be a good idea to link everything to default2.asp, why not link everything to the root, and just leave default2.asp as the "default" file.
Anyway, I ran a check:
GET / HTTP/1.1
Host: dowcompany.com
Result
HTTP/1.1 301 Moved Permanently
Connection: close
Date: Tue, 21 Jun 2005 09:15:14 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Location: http://www.dowfence.com/default2.asp
and
GET / HTTP/1.1
Host: www.dowcompany.com
gives:
HTTP/1.1 301 Moved Permanently
Connection: close
Date: Tue, 21 Jun 2005 09:19:05 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
Location: http://www.dowfence.com/default2.asp
Seems to be working OK!
Cheers,
Paz.
ptpnewmedia
06-21-2005, 06:05 AM
Well I tried that but it was kind of wierd. All of those domains point to the same file (previosly default.asp). When I tried to route the "other" domains to www.dowfence.com, the page would never load b/c I think it kept trying to load the same page (if that makes sense).
Just now as I was typing, what if I did this, I point the "other" domains to default2.asp in the root folder and then reroute them to www.dowfence.com (which will be default.asp).
I am going to go ahead and make the changes but let me know if this sounds like a plan.
Hi,
I'm not sure I understand, but I would say that you should direct all domains to a root directory ie http://www.somesite.com/
Then using your hosting control panel, you can set the default file to be opened in the root directory as "default2.asp".
Cheers,
Paz.
ptpnewmedia
06-27-2005, 08:43 AM
Here is the problem I am having with this. I tried redirecting to the root and it seems to get into an endless loop.
The code:
<%
Response.Status = "301 Moved Permanently"
Response.addheader "Location", "http://www.dowfence.com"
Response.End
%>
The problem:
I think is that when ever someone visits www.dowcompany.com it redirects them to the www.dowfence.com. Once it hits www.dowfence.com it keeps going back to www.dowfence.com over and over again.
When I kept the default page and forwarded over to www.dowfence.com/default2.asp, I had no problem with this.
My idea:
Create new folder and point domains to that folder.
Ex: Both www.dowfence.com and www.dowcompany.com point to root/somefolder/default.asp. The default.asp file will then have the 301 redirect code pointing back to root/default.asp
Please let me know how this sounds. I am trying to get this thing resolved for them so they do not get penalized for double content.
Hi,
The simpler single redirect to a domain rather than a page would be better I think, and I would definitely avoid having a series of redirects.
Have you tried 301 domain forwarding but with the final forward slash ie
Response.addheader "Location", "http://www.dowfence.com/"
see if that works. There's something in the back of my mind about that final forward slash...
If not can you tell us if you are running IIS server or a control panel?
Cheers,
Paz.
ptpnewmedia
06-27-2005, 01:12 PM
I have made the change using the forward slash.
Code:
<%
Response.Status = "301 Moved Permanently"
Response.AddHeader "Location", "http://www.dowfence.com/"
Response.End
%>
Problem:
It still does the stupid loop. I will leave this for a bit so you can check the headers and you will see the loop.
dowfence.com
dowcompany.com
www.dowcompany.com
http://www.seoconsultants.com/tools/headers.asp#results
We are using a control panel (1 and 1 hosting).
ptpnewmedia
06-27-2005, 01:25 PM
It is gone...
LOL.... ok I believe you....
Looks like you've got another redirect that's causing a loop of some sort.
Have a look in your root directory, I can't remember but maybe it's in global.asa or something.
I don't know which version of control panel you are using, but I have redirect as an option under dns server > redirect script (shouldn't be one for dowfence but you should check).
and I can change my default file under Web/ftp server > tools > permissions > web server settings, which will define which file will be opened by default if you type www.yoursite.com/ (you should check that file for any asp code too.)
Yours will be similar. If you can't find the problem, I'm sure your hosting company can sort out the problem in a few minutes. If not, I'd be prepared to have a look for you, we could do it together with WinVNC or something.
But it's 1:00 am and I'm off to bed now...... :nap:
Cheers,
Paz.
ptpnewmedia
07-27-2005, 07:17 AM
Hey Paz,
A month later and I think we got it working out now. B/c we did not have access to control the server for redirects (except 302) and the code we were using put us into a loop, we had to get creative.
Here is what we ended up doing. This is thanks to alot of research and looking at others code. I love the Internet.
<%
dim safeURL
'***** ONLY CHANGE THE LINE BELOW *****
safeURL = "www.dowfence.com" 'domain name
'***** ONLY CHANGE THE LINE ABOVE *****
dim requestedURL
dim requestedWithPre
dim pre
dim sendTo
pre = "www."
requestedURL = LCase(Request.ServerVariables("SERVER_NAME"))
If InStr(1, requestedURL, "www.", 1) = 1 Then requestedWithPre = True
If (requestedURL <> safeURL) AND (requestedURL <> pre & safeURL) Then
sendTo = "http://"
If requestedWithPre Then
sendTo = sendTo & pre & safeURL
Else
sendTo = sendTo & safeURL
End If
Response.Status = "301 Moved Permanently"
Response.AddHeader "Location", sendTo
End If
%>
I have already checked the headers for:
dowcompany.com
www.dowcompany.com
dowfence.com
and everything looks great. If you don't mind, could you double check to make sure. Thanks so much!
Hi,
it seems to mostly be ok, but I'm seeing a cookie generated..... probably because of the asp, but I've not seen that before, but I've not looked either.
Anyway the urls you listed either 301 redirect ok, or return a 200 OK, but it only seems to work for the homepage, but I guess that's good enough.
I tried a url that you didn't list "www.dowfence.com" and that redirected to "www.www.dowcompany.com"... isn't that a problem?
It mostly works ok, but I think you should looking for a new host.... :rolleyes:
Cheers,
Paz.
vBulletin v3.0.3, Copyright ©2000-2013, Jelsoft Enterprises Ltd.