iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
Search Engine Optimization Forum SEO is much easier with help from peers and experts! The WebProWorld SEO forum is for the discussion and exploration of various search engine optimization topics. Any non (engine) specific SEO or SEM topics should go here.

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-25-2007, 10:24 AM
WebProWorld Member
 
Join Date: Feb 2005
Posts: 30
gbb011 RepRank 0
Default 301 Redirect

Hello,

I'm looking to use the http://www.mysite.com as the authority URL. I'm running on a shared windows server and have to use code
rather than IIS itself to do the 301 redirect.

I've a few questions I hope you can help me with.

Firstly, should I have a 301 redirect for http://mysite.com, http://www.mysite.com/index.aspx and http://www.mysite.com/
that go to http://www.mysite.com

Should I have a 301 redirect on every page? or just the homepage.
So for example if someone typed in http://mysite.com/foldername/page1.aspx should that redirect to
http://www.mysite.com/foldername/page1.aspx

Thirdly, I found some code that redirects http://mysite.com to http://www.mysite.com/index.aspx, but surely that isn't solving the issue and is just the same as having both http://www.mysite.com and http://mysite.com

thanks.
GBBB.
Reply With Quote
  #2 (permalink)  
Old 04-25-2007, 11:35 AM
WebProWorld New Member
 
Join Date: Apr 2007
Location: the Netherlands / Den Haag
Posts: 16
wwarobert RepRank 0
Default

Quote:
Firstly, should I have a 301 redirect for http://mysite.com, http://www.mysite.com/index.aspx that go to http://www.mysite.com
Yes, you must dispose duplicate content problem

Quote:
Should I have a 301 redirect on every page? or just the homepage.
So for example if someone typed in http://mysite.com/foldername/page1.aspx should that redirect to
http://www.mysite.com/foldername/page1.aspx
you can do no.1 in apache (server) configuration
and this solve your second problem automatically
__________________
Powerful emailmarketing platform newsletters, nieuwsbrief.
Responsible for registration and activation of 0800 and 0900 numbers.
Reply With Quote
  #3 (permalink)  
Old 04-25-2007, 12:03 PM
WebProWorld Member
 
Join Date: Feb 2005
Posts: 30
gbb011 RepRank 0
Default

Sorry, I have to do it in code (asp.net) as I don't have access to the windows server so unfortunately that doesn't help.
Reply With Quote
  #4 (permalink)  
Old 04-25-2007, 12:15 PM
WebProWorld New Member
 
Join Date: Apr 2007
Location: the Netherlands / Den Haag
Posts: 16
wwarobert RepRank 0
Default

ok, but conclusion is that you must redirect all url's whithout www for example http://mysite.com/foldername/page1.aspx => http://www.mysite.com/foldername/page1.aspx
otherwise you have the same content for two different url's (duplicate content).

about asp, sorry I can't help you - I can show you how do this in php.
__________________
Powerful emailmarketing platform newsletters, nieuwsbrief.
Responsible for registration and activation of 0800 and 0900 numbers.
Reply With Quote
  #5 (permalink)  
Old 04-25-2007, 06:20 PM
incrediblehelp's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: Jan 2004
Location: Live in Cincy Now
Posts: 7,573
incrediblehelp RepRank 4incrediblehelp RepRank 4incrediblehelp RepRank 4incrediblehelp RepRank 4incrediblehelp RepRank 4
Default

gbb011 have you asked the hoster how they recommend doing this?
Reply With Quote
  #6 (permalink)  
Old 04-26-2007, 05:35 AM
WebProWorld Member
 
Join Date: Feb 2005
Posts: 30
gbb011 RepRank 0
Default

IncredibleHelp they don't offer 301 redirects.
They recommended using code like

private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location","http://www.mysite.com/newpage");
}

But I just wondered if this code is more applicable where a single page has been changed.

For instance if someone links to a page(s) on my site like http://mysite.com/test.aspx I'd like it to go to http://www.mysite.com/test.aspx so that both versions aren't indexed by Google as separate pages.

thanks.
Reply With Quote
  #7 (permalink)  
Old 04-26-2007, 06:09 AM
WebProWorld New Member
 
Join Date: Apr 2007
Location: the Netherlands / Den Haag
Posts: 16
wwarobert RepRank 0
Default

I have found something like that :

Code:
<%
  ' If the server name is not www.sitename.com we can do the redirect to www.sitename.com. 
  ' The only time we can is if the method is a GET
  ' (no way to pass along the POST arguments) and its on port 80 (don't want to redirect the SSL).
if ( strcomp( lcase( Request.ServerVariables("SERVER_NAME") ) , "www.sitename.com", 1 ) <> 0 _
    AND Request.ServerVariables("SERVER_PORT") = 80 _
    AND strcomp( lcase( Request.ServerVariables("REQUEST_METHOD") ) , "get" , 1 ) = 0 _
) then
    URL = "http://www.sitename.com" & Request.ServerVariables("SCRIPT_NAME")
    if len ( request.servervariables("QUERY_STRING" ) ) > 0 then
        URL = URL + "?" + request.servervariables("QUERY_STRING" )
    end if
    Response.Status="301 Moved Permanently"
    Response.AddHeader "Location", URL
    Response.End
end if
%>
__________________
Powerful emailmarketing platform newsletters, nieuwsbrief.
Responsible for registration and activation of 0800 and 0900 numbers.
Reply With Quote
  #8 (permalink)  
Old 04-26-2007, 06:26 AM
WebProWorld Member
 
Join Date: Jan 2007
Location: India
Posts: 38
ddwebguru RepRank 0
Default

First pl read this url > http://www.beyondink.com/howtos/301-redirect.html

here you can find

>>>>>>>>>
Microsoft IIS Web Server
Note: these instructions require administrative access to IIS. If you do not have this access (e.g., if you have a shared hosting account on a Windows server), you should use one of the server-side scripting methods such as ASP or PHP given further below.

Single Page Redirect:

1. Open Internet Services Manager and right-click on the file or folder you wish to redirect.
2. Select the radio button "a redirection to a URL".
3. Enter the desitnation page for the redirect.
4. Check "The exact url entered above" and the "A permanent redirection for this resource".
5. Hit "Apply".
>>>>>>>>>
you can try with this redirection code >>>>>>>>>

Active Server Pages (ASP)
Single Page Redirect:
<%
Response.Status="301 Moved Permanently"
Response.AddHeader='Location','http://www.new-url.com/'
%>

One more thing you can solve the canonical issue with the help of google webmaster tool, there you can choose a domain (with www, or without www )

hope this will help you.........
Reply With Quote
  #9 (permalink)  
Old 04-26-2007, 06:39 AM
WebProWorld Member
 
Join Date: Jan 2007
Location: India
Posts: 38
ddwebguru RepRank 0
Default

or you can try with this code - write it in a asp.net page >>

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>
Reply With Quote
  #10 (permalink)  
Old 04-26-2007, 01:37 PM
incrediblehelp's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: Jan 2004
Location: Live in Cincy Now
Posts: 7,573
incrediblehelp RepRank 4incrediblehelp RepRank 4incrediblehelp RepRank 4incrediblehelp RepRank 4incrediblehelp RepRank 4
Default

Quote:
Originally Posted by ddwebguru
Note: these instructions require administrative access to IIS.
ddwebguru he doesnt have access to the IIS control panel.
Reply With Quote
  #11 (permalink)  
Old 04-26-2007, 06:25 PM
WebProWorld New Member
 
Join Date: Jan 2007
Posts: 21
covingtonscustoms RepRank 0
Default

This is the asp code i use, i place it at the top of each asp page.

Code:
<%@ Language=VBScript %>
<%
Dim sHttps, sURL, sPath, sQuery, sAddr
sHttps = Request.ServerVariables("HTTPS") 
sURL = Request.ServerVariables("HTTP_HOST")
sPath = Request.ServerVariables("PATH_INFO")
sQuery = Request.ServerVariables("QUERY_STRING")
if (sHttps <> "on") then
sHttps = "http://"
else
sHttps = "https://"
end if
if (sPath = "/flash.asp") then 
sPath = "/"
end if
if (sQuery <> "") then 
sQuery = "?" & sQuery
sPath = sPath & sQuery
end if
sAddr = sHttps & sURL
if (sAddr <> "https://www.covingtonscyclecity.com") then
Response.Status="301 Moved Permanently"
Response.AddHeader "Location", "https://www.covingtonscyclecity.com" & sPath
end if
%>
this will redirect any page that does not start with "https://www.covingtonscyclecity.com"
it also adds the path and query string to the address.
My default pages are named "flash.asp" and are hidden so my default pages show up as:
"https://www.covingtonscyclecity.com/"
instead of:
"https://www.covingtonscyclecity.com/flash.asp"
Reply With Quote
  #12 (permalink)  
Old 04-27-2007, 02:08 AM
WebProWorld Member
 
Join Date: Jan 2007
Location: India
Posts: 38
ddwebguru RepRank 0
Default

incrediblehelp - you are right if he has not access it not work. then he can try
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>

or "covingtonscustoms" has some idea.
But there is no comment from "GBBB"
Reply With Quote
Reply

  WebProWorld > Search Engines > Search Engine Optimization Forum

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



All times are GMT -4. The time now is 09:53 PM.



Search Engine Optimization by vBSEO 3.3.0