Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14
  1. #1
    Senior Member
    Join Date
    Mar 2010
    Posts
    104
    Member #
    21316
    Liked
    1 times

    301 redirect windows 2003 iis6 - need to stop duplicate content for SEO

    Hi,

    I've posted a thread once before on this forum regarding this topic and I can't seem to find it ... but nevertheless I seriously need to find a solution to a 301 redirect for my websites so that there is no duplicate content... and I know duplicate content obviously effects your rankings negatively by splitting the pages! I'm sick of losing out because of this!!

    I'm using a dumb@ss windows 2003 server using iis6.

    Correct me if I'm wrong:

    After a bit a bit of research I figured I needed to have a URL Rewrite Extension for iis6 2003 in order to succeed... so I googled that and found a website that explains it nice and clear:

    Installation of URL Rewriting module (IIRF) for IIS6/IIS7 | Web-Site-Scripts.com

    Is this exactly what I have to do?

    So if I am correct at the moment my domain name (without 301 redirect) is like:

    www.domain.com
    http://domain.com
    www.domain.com/
    http://domain.com/
    www.domain.com/index.htm
    http://domain.com/index.htm

    So my juice has been split into 6!!!
    Obviously I need to go from 6 to 1 being only:

    www.domain.com

    NOTE: Please understand that I am a server dummy unfortunately
    I really need to get to the bottom of this so I appreciate your help once again

  2.  

  3. #2
    Senior Member
    Join Date
    Mar 2010
    Posts
    104
    Member #
    21316
    Liked
    1 times
    I've just found a website that seems to do what I want a bit easier than the website I posted above:

    SEO Canonical URLs And 301 Redirects In Windows IIS 6, IIS 7

    Is this the direction I need to go?

  4. #3
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,485
    Member #
    425
    Liked
    2783 times
    They'll both work. The example from web.config requires the URL rewriting module.

    Personally, I'd go the global.asax route. It's more flexible. I use a modified version of that.

    The other thing I'd suggest (and by suggest, I mean "strongly recommend") is that whoever this is for upgrade the server to at least Windows Server 2008, and ideally Windows Server 2012. Extended support for Windows Server 2003 ends next year.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  5. #4
    Senior Member
    Join Date
    Mar 2010
    Posts
    104
    Member #
    21316
    Liked
    1 times
    Thank dude - I thought you'd be the first to reply!

    The other thing I'd suggest (and by suggest, I mean "strongly recommend") is that whoever this is for upgrade the server to at least Windows Server 2008, and ideally Windows Server 2012. Extended support for Windows Server 2003 ends next year.
    Woah! When you say "Extended support for Windows Server 2003 ends next year" - what exactly do you mean?
    I've got a sh** load of websites and domains on that server!

    Personally, I'd go the global.asax route. It's more flexible. I use a modified version of that.
    Okay because that looks like a much easier route to go, I'm happy with that though this website ...
    SEO Canonical URLs And 301 Redirects In Windows IIS 6, IIS 7
    ... doesn't explain it step by step so that's where I need help ...

    Where do I put the code that he says needs to be added:


    Sub Application_BeginRequest(ByVal sender as Object, ByVal e as EventArgs)

    Try
    Dim requestedDomain As String = HttpContext.Current.Request.Url.ToString().toLower ()

    If InStr(requestedDomain, "http://yoursite.com") Then

    requestedDomain = requestedDomain.Replace("http://yoursite.com", "http://www.yoursite.com")

    Response.Clear()
    Response.Status = "301 Moved Permanently"
    Response.AddHeader("Location", requestedDomain)
    Response.End()

    End If

    Catch ex As Exception
    Response.Write("Error in Global.asax :" & ex.Message)
    End Try

    End Sub
    ?

    Okay I know it must go into the global.asax but where do I find it?

    Do I do this:

    1) Open up IIS
    2) Click on Websites
    3) Right click the domain name (wesbite) I want to do this 301 redirect to and click PROPERTIES
    4) Click on the ASP.NET tab
    5) Click on what Edit Global Configuration or Edit Configuration ?
    6) and then what?

    Or is that the completely wrong way to approach it?

  6. #5
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,485
    Member #
    425
    Liked
    2783 times
    Global.asax is a file you create in the root of each website. It's not something you find as such.

    Microsoft Product Lifecycle Search <-- this is what I mean by "end of life". There will be no support at all for Windows Server 2003 after July 14, 2015. If your OS gets hacked after that, you're on your own...MS won't help you. Chances are your host will force you to migrate for this reason.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  7. #6
    Senior Member
    Join Date
    Mar 2010
    Posts
    104
    Member #
    21316
    Liked
    1 times
    Global.asax is a file you create in the root of each website. It's not something you find as such.
    I don't believe that it's just a matter of adding this code:

    Sub Application_BeginRequest(ByVal sender as Object, ByVal e as EventArgs)

    Try
    Dim requestedDomain As String = HttpContext.Current.Request.Url.ToString().toLower ()

    If InStr(requestedDomain, "http://yoursite.com") Then

    requestedDomain = requestedDomain.Replace("http://yoursite.com", "http://www.yoursite.com")

    Response.Clear()
    Response.Status = "301 Moved Permanently"
    Response.AddHeader("Location", requestedDomain)
    Response.End()

    End If

    Catch ex As Exception
    Response.Write("ErrorGGlobal.asax :" & ex.Message)
    End Try

    End Sub
    in a text file and then renaming it global.asax and then putting it in the root of my website folder??
    Surely you've got to do something else in IIS (iis6)?

  8. #7
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,485
    Member #
    425
    Liked
    2783 times
    Well, if you want to make it even simpler, there is a way.

    1) Download Visual Web Developer Express from the Microsoft Web Platform (they may call it Visual Studio Express now, but I'm not sure). It's free and an awesome, albeit horribly named, text editor.

    2) Open up the website you're working on.

    3) Create a New File...global.asax.

    You'll see a generic templated global.asax file. Just copy and paste the other code in. It is a simple text file.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  9. #8
    Senior Member
    Join Date
    Mar 2010
    Posts
    104
    Member #
    21316
    Liked
    1 times
    1) Download Visual Web Developer Express from the Microsoft Web Platform (they may call it Visual Studio Express now, but I'm not sure). It's free and an awesome, albeit horribly named, text editor.
    Could I not just use dreamweaver instead? Or simply open up NOTEPAD, then add the code > save as global.asax ?

    You'll see a generic templated global.asax file. Just copy and paste the other code in. It is a simple text file.
    Stupid question asking you but are you sure there's nothing else I need to do?
    Is this code:

    Sub Application_BeginRequest(ByVal sender as Object, ByVal e as EventArgs)

    Try
    Dim requestedDomain As String = HttpContext.Current.Request.Url.ToString().toLower ()

    If InStr(requestedDomain, "http://yoursite.com") Then

    requestedDomain = requestedDomain.Replace("http://yoursite.com", "http://www.yoursite.com")

    Response.Clear()
    Response.Status = "301 Moved Permanently"
    Response.AddHeader("Location", requestedDomain)
    Response.End()

    End If

    Catch ex As Exception
    Response.Write("ErrorGGlobal.asax ex.Message)
    End Try

    End Sub
    All I need to add (obviously change the domain name) in order to get every duplicate variation like in my example:

    www.domain.com
    http://domain.com
    www.domain.com/
    http://domain.com/
    www.domain.com/index.htm
    http://domain.com/index.htm

    to put all the SEO juice into my preferred choice of :

    www.domain.com?

  10. #9
    Unpaid WDF Intern TheGAME1264's Avatar
    Join Date
    Dec 2002
    Location
    Not from USA
    Posts
    14,485
    Member #
    425
    Liked
    2783 times
    You could use any of those programs and do this, yes. The point I was making is that it really is that simple.
    If I've helped you out in any way, please pay it forward. My wife and I are walking for Autism Speaks. Please donate, and thanks.

    If someone helped you out, be sure to "Like" their post and/or help them in kind. The "Like" link is on the bottom right of each post, beside the "Share" link.

    My stuff (well, some of it): My bowling alley site | Canadian Postal Code Info (beta)

  11. #10
    Senior Member
    Join Date
    Mar 2010
    Posts
    104
    Member #
    21316
    Liked
    1 times
    I'm still battling to believe it because I've been trying to figure this out for like almost years and then a simple solution like this was all that was needed?! ... I need to see it to believe it haha!


Page 1 of 2 1 2 LastLast

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Tags for this Thread

All times are GMT -6. The time now is 05:45 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com