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. 301 Redirect with index.asp

    301 Redirect with index.asp

    Technical SEO Issues
    37 4 1.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.
    • TroyW
      TroyW @Mike.Goracke last edited by

      ok thats  great information since we only have a few sections where HTTPS is enforced and the cleaner I can make things the better.

      That said here is what I have now in my web.config file so

      1. how would I best integrate what you have above with this?

      2. As I add new sections for HTTPS is it a single line for each new pattern, i.e. like "purchase" for example.

      3. Am I correct that the "MatchAll" is for non case sensitivity?

      <system.webserver><rewrite><rewritemaps><rewritemap name="Redirect"><add key="/index.asp" value="/"></add></rewritemap></rewritemaps>
                  <rules><rule name="CanonicalHostNameRule" enabled="true"><match url="(.*)"><conditions logicalgrouping="MatchAll" trackallcaptures="false"><add input="{HTTPS}" pattern="^ON$"><add input="{HTTP_HOST}" pattern="^www.lucid8.com$" negate="true"></add></add></conditions>
                          <action type="Redirect" url="http://www.lucid8.com/{R:1}" redirecttype="Permanent"  =""></action></match></rule></rules></rewrite></system.webserver>

      Mike.Goracke 1 Reply Last reply Reply Quote 0
      • Mike.Goracke
        Mike.Goracke @TroyW last edited by

        MatchAll means that all of the conditions must be met for the rule to process. It has nothing to do with case sensitivity.

        Give this a whirl (I added your example of including a purchase folder in the rule):

        <system.webserver><rewrite><rewritemaps><rewritemap name="Redirect"><add key="/index.asp" value="/"></add></rewritemap></rewritemaps>
                <rules><rule name="CanonicalHostNameRule" enabled="true"><match url="(.)"><conditions logicalgrouping="MatchAll" trackallcaptures="false"><add input="{HTTPS}" pattern="^ON$"> 
                            <add input="{HTTP_HOST}" pattern="^www.lucid8.com$" negate="true"></add></add></conditions>
                        <action type="Redirect" url="<a href=" http:="" www.lucid8.com="" {r:1"="">http://www.lucid8.com/{R:1}" redirectType="Permanent"  />
                   </action></match></rule>
                    <rule name="AllHTTPexceptSIGNIN" stopprocessing="true"><conditions><add input="{HTTP_HOST}" pattern="<a href=" http:="" (www.)(.
        )$"="">http://(www.)(.*)$" negate="true" />
                            <add input="{HTTPS}" pattern="on"><add input="{URL}" pattern="download" negate="true"><add input="{URL}" pattern="purchase" negate="true"></add></add></add></add></conditions>
                        <action type="Redirect" url="<a href=" http:="" {http_host}="" {r:0"="">http://{HTTP_HOST}/{R:0}" redirectType="Permanent"/>
                   </action></rule></rules></rewrite></system.webserver>

        TroyW 1 Reply Last reply Reply Quote 0
        • MichaelC-15022
          MichaelC-15022 @Mike.Goracke last edited by

          I'll second Mike's comment about using Screaming Frog to test immediately.

          The only thing I'll add is that it's worth doing an httpfox test of one example page to make sure you don't have a chain of redirects from your combinations of rules--Screaming Frog will just show you 1 of the response codes per page (it's unclear to me if it's the first or the the last response code).  You'll catch things like one of the redirects in the chain being a 302 not a 301 (for instance, a basic Response.Redirect in the ASP code itself does a 302, not a 301!).

          TroyW 1 Reply Last reply Reply Quote 0
          • MichaelC-15022
            MichaelC-15022 @TroyW last edited by

            You're pretty much on track with this now.  The key points are:

            • nothing outside of your web config file should be aware of what your home page's file name actually is
            • Googlebot, your menu, etc. should all see your home page as /
            • any existing links to index.asp should be 301 redirected to / to consolidate the link juice

            And, the reason you're renaming index.asp to something else is that otherwise you'd have an infinite redirection loop of index.asp -> / -> gets resolved to index.asp -> / -> ....

            TroyW 1 Reply Last reply Reply Quote 0
            • TroyW
              TroyW @MichaelC-15022 last edited by

              Excellent Info

              thanks

              1 Reply Last reply Reply Quote 0
              • TroyW
                TroyW @Mike.Goracke last edited by

                Sorry for the delay in response, had another fire to deal with....

                Anyway I put this in place and it just doesn't seem to work, i.e.

                1. if I put in lucid8.com I would expect it to correct itself to www.lucid8.com or http://www.lucid8.com however instead it just opens the page and keeps lucid8.com in the URL.   Any ideas here?

                2. I also notice that from that point on when I click to navigate to another place on the site that the URL stays without the www and I am going to guess that is because some of the pages have ABSOLUTE paths, i.e. www.lucid8.com/purchase/login.asp while others are relative, i.e /purchase/login.asp

                So I guess two questions here i.e.

                A: any idea how to track down why the redirect in the web.config is not working?

                B: if we get # 1 working will it solve the # 2 issue or do we need to change all relative paths to absolute?

                thanks

                1 Reply Last reply Reply Quote 0
                • TroyW
                  TroyW @MichaelC-15022 last edited by

                  Sorry for the delayed response, been buried putting out other fires.  That said

                  1. The web.config  has the following in place so it refers to /

                  <rewritemaps><rewritemap name="Redirect"><add key="/index.asp" value="/"></add></rewritemap></rewritemaps>

                  2. All of my menu systems and links now reference the home page as www.lucid8.com or as / which I assume should not be an issue?

                  3. The only issue outstanding is your recommendation to

                  A: copy index.asp to home.asp

                  B: then would I strip the entire contents from index.asp and put some type of code within to tell it to look at home.asp?  if so any help you have here would be appreciated.

                  NOTE:  I am still a bit lost as to why I would have to do 3.a & b since steps 1 & 2 would seem to resolve the issue, but perhaps I am missing a critical point?

                  MichaelC-15022 1 Reply Last reply Reply Quote 0
                  • MichaelC-15022
                    MichaelC-15022 @TroyW last edited by

                    If your default document is index.asp, and you're redirecting index.asp to /, then I would expect you'd get an infinite redirection loop.

                    TroyW 1 Reply Last reply Reply Quote 0
                    • TroyW
                      TroyW @MichaelC-15022 last edited by

                      Hmm well no all seems to be working well here, although the code in the web.config doesn't seem to be working for redirects, i.e. I can put in lucid8.com and it does not change to www.lucid8.com so maybe its not picking up the changes in web.config?

                      MichaelC-15022 1 Reply Last reply Reply Quote 0
                      • MichaelC-15022
                        MichaelC-15022 @TroyW last edited by

                        Yes, that looks to me like 2 clues that both say that the web.config isn't being read for some reason.

                        TroyW 1 Reply Last reply Reply Quote 0
                        • TroyW
                          TroyW @MichaelC-15022 last edited by

                          Yup something very strange.   So it appears that

                          1. the redirect code in the web.config does not work

                          2. I may have something else going on because whenever I enter lucid8.com it redirects to https://www.lucid8.com so wondering if you have any ideas as to how I might track down WHAT exactly is making the page change to from Lucid8.com to https://www.lucid8.com???

                          MichaelC-15022 1 Reply Last reply Reply Quote 0
                          • MichaelC-15022
                            MichaelC-15022 @TroyW last edited by

                            Sounds like something in a web.config file.  Is there possibly a web.config file in a higher-level folder?

                            Or, perhaps there's an IIS plugin that you're using that is doing this?

                            TroyW 1 Reply Last reply Reply Quote 0
                            • TroyW
                              TroyW @MichaelC-15022 last edited by

                              ok so I figured out a workaround since it appears that because I am on IIS6 the web.config is a but finicky aka may or may not work for redirection.  Anyway I used the information in this link http://johnnycode.com/2012/01/04/in-iis6-http-301-redirect-from-non-www-to-www/ to create a now non-www site and point it to the www site and all seems to be working well, expect if a person puts in a HTTPS within the WWW but that should be a really rare event so I am not going to hassle with it.    I also got rid of the relative URLS on the website and made them all explicit.

                              Fingers crossed that next run will show this issue is cleaned up....

                              Thanks for all your help and patience

                              MichaelC-15022 1 Reply Last reply Reply Quote 0
                              • MichaelC-15022
                                MichaelC-15022 @TroyW last edited by

                                Good, I'm glad you got this all working.  MC

                                TroyW 1 Reply Last reply Reply Quote 0
                                • TroyW
                                  TroyW @MichaelC-15022 last edited by

                                  Hey thought that I would also mention that the issue where it was referring from Lucid8.com to Https://Lucid8.com was actually a bug in firefox.  Apparently FF has a bug where IF you ever went to say Https://Lucid8.com in the past, even though you enter lucid8.com it will autocorrect upon submission and send you to Https://Lucid8.com

                                  They say that removing the HTTPS items from history will fix it, but in my case it did not and instead I had to export all my bookmarks, kill off the profile and then import the bookmarks again and now all is well.

                                  MichaelC-15022 1 Reply Last reply Reply Quote 0
                                  • MichaelC-15022
                                    MichaelC-15022 @TroyW last edited by

                                    That's brutal!  I've seen something like that happen watching the HTTP responses via httpfox sometimes, where I've made a change on the server to a redirection and not seeing it in the browser.

                                    TroyW 1 Reply Last reply Reply Quote 0
                                    • TroyW
                                      TroyW @MichaelC-15022 last edited by

                                      Yeah a major pain and went round and round since it was happening on all machines.  Once I got a machine that didn't do it it got me thinking..

                                      Anyway hope it helps others in the future

                                      1 Reply Last reply Reply Quote 0
                                      • 1
                                      • 2
                                      • 2 / 2
                                      • First post
                                        Last post
                                      • 404 Errors for Form Generated Pages - No index, no follow or 301 redirect
                                        Ric_McHale
                                        Ric_McHale
                                        0
                                        5
                                        549

                                      • 301 redirects reverting to 302 redirects
                                        Devanur-Rafi
                                        Devanur-Rafi
                                        0
                                        6
                                        532

                                      • 301 Redirect with ASP (not .NET)
                                        Hughescov
                                        Hughescov
                                        0
                                        2
                                        550

                                      • Index.php and 301 redirect with Joomla
                                        SanketPatel
                                        SanketPatel
                                        0
                                        2
                                        2.1k

                                      • 301 redirect from root to /index.aspx
                                        Dr-Pete
                                        Dr-Pete
                                        0
                                        11
                                        1.7k

                                      • 301 Redirect Domain or 301 Redirect Domain + Interior Pages
                                        Room214
                                        Room214
                                        0
                                        7
                                        1.1k

                                      • Will Google index a 301 redirect for a new site?
                                        StephanM
                                        StephanM
                                        0
                                        2
                                        666

                                      • Why is a 301 redirected url still getting indexed?
                                        dim_d
                                        dim_d
                                        0
                                        6
                                        1.1k

                                      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