The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

    Browse the forum for helpful insights and fresh discussions about all things SEO.

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. Technical SEO Issues
    4. How to make multiple url redirection using global.asax in IIS 6?

    How to make multiple url redirection using global.asax in IIS 6?

    Technical SEO Issues
    2 2 2.4k
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • VipinLouka78
      VipinLouka78 last edited by

      sir,

      I am working with IIS 6 site and i ant to redirect three different urls of a domain to one url, i.e, there are the different versions of the same url...so how can i create one? I have found a script on google. but it says redirecting one url. see it here:

      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
      
      1 Reply Last reply Reply Quote 0
      • lavellester
        lavellester last edited by

        I'd recommend implementing 301 at the server level e.g. in IIS settings rather than the code level.

        There are loads of guides on this - just search for "301 iis6 redirect" on your favourite search engine.

        Hope this helps.

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post
        • Clean URL vs. Parameter URL and Using Canonical URL...That's a Mouthfull!
          Roman-Delcarmen
          Roman-Delcarmen
          0
          4
          170

        • Using a 302 redirect for language variants. How should I use the canonical?
          GPainter
          GPainter
          0
          4
          50

        • If I want clean up my URLs and take the "www.site.com/page.html" and make it "www.site.com/page" do I need a redirect?
          Booj
          Booj
          0
          4
          113

        • Multiple URLs
          RyanKent
          RyanKent
          0
          4
          311

        • Crawl reveals hundreds of urls with multiple urls in the url string
          irvingw
          irvingw
          0
          5
          455

        • Redirect non-www if using canonical url?
          RobertFisher
          RobertFisher
          0
          3
          515

        • Old URL redirect to New URL
          Dr-Pete
          Dr-Pete
          0
          7
          695

        • Our Development team is planning to make our website nearly 100% AJAX and JavaScript. My concern is crawlability or lack thereof. Their contention is that Google can read the pages using the new #! URL string. What do you recommend?
          john4math
          john4math
          0
          2
          651

        Get started with Moz Pro!

        Unlock the power of advanced SEO tools and data-driven insights.

        Start my free trial
        Products
        • Moz Pro
        • Moz Local
        • Moz API
        • Moz Data
        • STAT
        • Product Updates
        Moz Solutions
        • SMB Solutions
        • Agency Solutions
        • Enterprise Solutions
        • Digital Marketers
        Free SEO Tools
        • Domain Authority Checker
        • Link Explorer
        • Keyword Explorer
        • Competitive Research
        • Brand Authority Checker
        • Local Citation Checker
        • MozBar Extension
        • MozCast
        Resources
        • Blog
        • SEO Learning Center
        • Help Hub
        • Beginner's Guide to SEO
        • How-to Guides
        • Moz Academy
        • API Docs
        About Moz
        • About
        • Team
        • Careers
        • Contact
        Why Moz
        • Case Studies
        • Testimonials
        Get Involved
        • Become an Affiliate
        • MozCon
        • Webinars
        • Practical Marketer Series
        • MozPod
        Connect with us

        Contact the Help team

        Join our newsletter
        Moz logo
        © 2021 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
        • Accessibility
        • Terms of Use
        • Privacy