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. Intermediate & Advanced SEO
    4. 301 redirect on Windows IIS. HELP!

    301 redirect on Windows IIS. HELP!

    Intermediate & Advanced SEO
    2 2 222
    • 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.
    • Jeepster
      Jeepster last edited by

      Hi

      My six-year-old domain has always existed in four forms:

      http://www**.**mydomain.com/index.html

      http://mydomain.com/index.html

      http://mydomain.com/

      http://www.mydomain.com

      My webmaster claims it’s “impossible” to do a 301 redirect from the first three to the fourth. I need simple instructions to guide him.

      The site’s hosted on Windows running IIS

      Here’s his rationale:

      These are all the same page, so they can’t redirect to themselves. Index.html is the default page that loads automatically if you don’t specify a page.

      If I put a redirect into index.html it would just run an infinite redirect loop.

      As you can see from the IIS set up, both www.mydomain and mydomain.com  point to the same location ( VIEW IMAGE HERE )

      _Both of these use index.html as the default document ( VIEW IMAGE 2 HERE ) _

      1 Reply Last reply Reply Quote 0
      • TakeshiYoung
        TakeshiYoung last edited by

        This is the code you want to add to your /htaccess file:

        #Options +FollowSymlinks
        Options +SymLinksIfOwnerMatch
        RewriteEngine on
        rewritecond %{http_host} ^domain.com [nc]
        rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]

        redirect 301 index.html http://www.domain.com/

        This will make it so http://www.domain.com/ is the correct link for your site.

        This should not result in any redirect loops unless you already have redirects in place.

        1 Reply Last reply Reply Quote 1
        • 1 / 1
        • First post
          Last post
        • Will this 301 redirects help me?
          Staunton_Rook
          Staunton_Rook
          0
          3
          35

        • 301 redirection help needed!
          Nigel_Carr
          Nigel_Carr
          3
          6
          86

        • Does removal of internal redirects(301) help in SEO
          vtmoz
          vtmoz
          0
          5
          571

        • How to use a 301 Redirect when the first 301 Redirect is not the same as what's indexed?
          PatriotOutfitters81
          PatriotOutfitters81
          0
          3
          66

        • 301 Redirect To Another 301 Redirect
          cbielich
          cbielich
          0
          5
          247

        • Big 301 Redirect Help!
          onwebtoday
          onwebtoday
          0
          2
          98

        • Time sensitive: HELP! We are having a problem doing a 301 redirect.....what can we do instead?
          PatriotOutfitters81
          PatriotOutfitters81
          0
          7
          148

        • Splitting one Website into 2 Different New Websites with 301 redirects, help?
          AdamThompson
          AdamThompson
          0
          5
          3.5k

        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