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. 301 Redirect from .html

    301 Redirect from .html

    On-Page / Site Optimization
    2 2 76
    • 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.
    • finelinewebsolutions
      finelinewebsolutions last edited by

      Hi there,

      Following on from this post:
      http://moz.com/community/q/help-with-duplicated-content

      Please could one confirm that using the following code in our htaccess file will stop the duplicated content issue we are having.

      RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^.]+.)+html?\ HTTP
      RewriteRule (.+).html?$ http://www.bereavementstationery.co.uk/$1 [R=301,L]
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_FILENAME}.html -f
      RewriteRule ^(.*)$ $1.html

      Kind Regards

      Alec

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

        If I understood correctly you changed all your urls from ending with .html to ending with /

        Please confirm you previously had the following urls:
        http://www.domain.com/somepage.html

        and now you have:
        http://www.domain.com/somepage.html

        If the above is correct the code I use to do the redirects is:

        RewriteEngine On
        RewriteRule (.+).html$ /$1/ [L,R]

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post
        • 301 redirects
          xinar
          xinar
          0
          3
          37

        • 301 Redirect or landing page
          GastonRiera
          GastonRiera
          0
          7
          624

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

        • 301 Redirect and SEO Rankings
          Radmandu
          Radmandu
          0
          5
          2.1k

        • Boatload of 301 Redirects Question
          MikeRoberts
          MikeRoberts
          0
          2
          82

        • How do I do a 301 Redirect in Wordpress
          ShaMenz
          ShaMenz
          0
          4
          716

        • 301 redirect -
          aidanlawlor
          aidanlawlor
          0
          4
          324

        • How do you create a 301 redirect for www.mysite..com/index.html in htaccess.
          davebrown1975
          davebrown1975
          0
          4
          738

        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