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. On-Page / Site Optimization
    4. How do you create a 301 redirect for www.mysite..com/index.html in htaccess.

    How do you create a 301 redirect for www.mysite..com/index.html in htaccess.

    On-Page / Site Optimization
    4 2 738
    • 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.
    • PerriCline
      PerriCline last edited by

      I understand that it is possible to create a 301 redirect for www.mysite..com/index.html to www.mysite.com. (as well as subdirectories.)  How is this accomplished?  My hosting company says that setting this up in htaccess will  cause "Apache to geti into an infinite loop and the page won’t load."  I have read on the forum that this is possible.  Any help would be greatly appreaciated.

      THanks. Perri

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

        Firstly make sure you have no on-site references to index.html else you'll be distilling your link juice. Ensure all references to you home page are www.mysite.com/

        For the redirect try the following:

        RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index.html\ HTTP/
        RewriteRule ^index.html$ http://www.mysite.com/ [R=301,L]

        PerriCline 1 Reply Last reply Reply Quote 1
        • PerriCline
          PerriCline @davebrown1975 last edited by

          Unfortunately we have off-site links that point to directory/index.html

          davebrown1975 1 Reply Last reply Reply Quote 0
          • davebrown1975
            davebrown1975 @PerriCline last edited by

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post
            • Hi, Is it bad SEO practice to create URLs with #ancor suffix?? lik http://www.diamonds-usa.com/category/diamond-engagement-rings/40-engagement-rings-w-side-stones.aspx#ancor
              ThompsonPaul
              ThompsonPaul
              1
              2
              70

            • https://www.freedomltd.com/stag-weekend/
              henandstag
              henandstag
              0
              3
              109

            • Duplicate Content aka 301 redirect from .com to .com/index.html
              omakad
              omakad
              0
              8
              1.5k

            • Does Bing consider http://www.domain.com the same as https://www.domain.com?
              DanFromUK
              DanFromUK
              0
              3
              1.2k

            • Blog.mysite.com or mysite.com/blog?
              creybot
              creybot
              0
              5
              912

            • Duplicate content http:// something .com and http:// something .com/
              BlueprintMarketing
              BlueprintMarketing
              0
              6
              771

            • Duplicate page content & title for www.mydomain.com and www.mydomain.com/index.php?
              Carl287
              Carl287
              0
              3
              500

            • 301 redirect (www.domain.com/index to www.domain.com)
              StalkerB
              StalkerB
              2
              12
              16.8k

            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