undefined
Skip to content
Moz logo Menu open Menu close
  • Products
    • Moz Pro
    • Moz Pro Home
    • Moz Local
    • Moz Local Home
    • STAT
    • Moz API
    • Moz API Home
    • Compare SEO Products
    • Moz Data
  • Free SEO Tools
    • Domain Analysis
    • Keyword Explorer
    • Link Explorer
    • Competitive Research
    • MozBar
    • More Free SEO Tools
  • Learn SEO
    • Beginner's Guide to SEO
    • SEO Learning Center
    • Moz Academy
    • SEO Q&A
    • Webinars, Whitepapers, & Guides
  • Blog
  • Why Moz
    • Agency Solutions
    • Enterprise Solutions
    • Small Business Solutions
    • Case Studies
    • The Moz Story
    • New Releases
  • Log in
  • Log out
  • Products
    • Moz Pro

      Your all-in-one suite of SEO essentials.

    • Moz Local

      Raise your local SEO visibility with complete local SEO management.

    • STAT

      SERP tracking and analytics for enterprise SEO experts.

    • Moz API

      Power your SEO with our index of over 44 trillion links.

    • Compare SEO Products

      See which Moz SEO solution best meets your business needs.

    • Moz Data

      Power your SEO strategy & AI models with custom data solutions.

    NEW Keyword Suggestions by Topic
    Moz Pro

    NEW Keyword Suggestions by Topic

    Learn more
  • Free SEO Tools
    • Domain Analysis

      Get top competitive SEO metrics like DA, top pages and more.

    • Keyword Explorer

      Find traffic-driving keywords with our 1.25 billion+ keyword index.

    • Link Explorer

      Explore over 40 trillion links for powerful backlink data.

    • Competitive Research

      Uncover valuable insights on your organic search competitors.

    • MozBar

      See top SEO metrics for free as you browse the web.

    • More Free SEO Tools

      Explore all the free SEO tools Moz has to offer.

    NEW Keyword Suggestions by Topic
    Moz Pro

    NEW Keyword Suggestions by Topic

    Learn more
  • Learn SEO
    • Beginner's Guide to SEO

      The #1 most popular introduction to SEO, trusted by millions.

    • SEO Learning Center

      Broaden your knowledge with SEO resources for all skill levels.

    • On-Demand Webinars

      Learn modern SEO best practices from industry experts.

    • How-To Guides

      Step-by-step guides to search success from the authority on SEO.

    • Moz Academy

      Upskill and get certified with on-demand courses & certifications.

    • SEO Q&A

      Insights & discussions from an SEO community of 500,000+.

    Unlock flexible pricing & new endpoints
    Moz API

    Unlock flexible pricing & new endpoints

    Find your plan
  • Blog
  • Why Moz
    • Small Business Solutions

      Uncover insights to make smarter marketing decisions in less time.

    • Agency Solutions

      Earn & keep valuable clients with unparalleled data & insights.

    • Enterprise Solutions

      Gain a competitive edge in the ever-changing world of search.

    • The Moz Story

      Moz was the first & remains the most trusted SEO company.

    • Case Studies

      Explore how Moz drives ROI with a proven track record of success.

    • New Releases

      Get the scoop on the latest and greatest from Moz.

    Surface actionable competitive intel
    New Feature

    Surface actionable competitive intel

    Learn More
  • Log in
    • Moz Pro
    • Moz Local
    • Moz Local Dashboard
    • Moz API
    • Moz API Dashboard
    • Moz Academy
  • Avatar
    • Moz Home
    • Notifications
    • Account & Billing
    • Manage Users
    • Community Profile
    • My Q&A
    • My Videos
    • Log Out

The Moz Q&A Forum

  • Forum
  • Questions
  • Users
  • Ask the Community

Welcome to the Q&A Forum

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

  1. Home
  2. SEO Tactics
  3. Reporting & Analytics
  4. Redirecting all URLs appended with index.htm or index.html

Moz Q&A is closed.

After more than 13 years, and tens of thousands of questions, Moz Q&A closed on 12th December 2024. Whilst we’re not completely removing the content - many posts will still be possible to view - we have locked both new posts and new replies. More details here.

Redirecting all URLs appended with index.htm or index.html

Reporting & Analytics
3
7
2.3k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as question
Log in to reply
This topic has been deleted. Only users with question management privileges can see it.
  • cceebar
    cceebar last edited by Sep 12, 2016, 12:58 PM

    It has come to my attention with one of my clients (WordPress website) that for some time they have within their Landing Page report (of GA - Google Analytics) URLs that should all be pointing to the one page, example:

    domain.com/about-us, also has a listing in GA as domain.com/about-us/index.htm

    Is this some kind of indication of a subdirectory issue? Has anyone had experience with this in such wordpress plugins as Yoast SEO, or other SEO plugin?

    My thoughts here are to simply redirect any of these non-existent files with a redirect in .htaccess - but what I'm using isn't working. I will insert the redirect here - - and any help would be greatly appreciated.

    RewriteEngine onRewriteCond %{THE_REQUEST} ^./index.html?
    RewriteRule ^(.
    )index.html?$ http://www.dupontservicecenter.com/$1 [R=301,L]

    and this rewrite doesn't work:

    RewriteEngine on
    RewriteRule ^(.+).htm$ http://dupontservicecenter.com/$1.php [R,NC]

    _Cindy

    1 Reply Last reply Reply Quote 0
    • cceebar
      cceebar @ThompsonPaul last edited by Sep 14, 2016, 2:26 PM Sep 14, 2016, 2:26 PM

      ThompsonPaul,

      Thank you! I've looked at that feature so many times, and read and reread the info Google provided, and clearly reading this information literally, as someone at my level would, it really doesn't specify whether adding the default page "adds" index.htm(l) to the url and therefore combines all "same-pages" or if it removes it to combine "same-pages"

      -- and I assumed the later since that is what happens with permalinks in WP... go figure. Now I realize it adds. Also it didn't occur to me that this feature wouldn't act as a filter would and you would see the results right away.

      OK so I have removed "index.htm" from the default page field, it is all clear now. Additionally I am also showing appended to my url's an "index.html" -- and this is in addition the actual url. So I am seeing, for example:

      /about-us/   /about-us/index.htm   and in some cases urls like /about-us/index.html.

      I can only guess that at one time both of these default urls were in the default page setting... "index.html" and "index.htm" And anyway these pages with index.htm(l) do not exist, ...which would explain that right, likely this issue concerns settings in GA

      1. So one more perplexing issue - in the search console landing page report I am showing 0 hits for any url appended with either index.htm or index.html.

      2. But in the regular reporting of landing pages, and also custom reporting, these pages are showing hits (pages appended w index.htm(l)). What could cause this discrepancy?

      3. As you suggestion it would take a bit of filtering to clean up these url's in Google Analytics? And so if it is in Google Analytics then any redirect in the htaccess file is for naught?

      4. So a several weeks, likely for this small business site, to begin showing clean urls and to see if this is actually this issue?

      Thank you so very much!

      _Cindy

      1 Reply Last reply Reply Quote 0
      • cceebar
        cceebar @ThomasHarvey last edited by Sep 14, 2016, 2:05 PM Sep 14, 2016, 2:05 PM

        Thomas, thank you for your help. I did occur to me that perhaps the order of items in the htaccess file may be the issue.

        I am going to look into this issue - thanks to your suggestion, and then see if my redirects are working as they should.

        When I do, I'll get back to you on this topic.

        Now, I'm trying to wrap my mind around the issue of why "index.htm and index html" when my site is WP based and therefore a PHP framework. ThompsonPaul has responded with what was my next look (and actually a 4th to 8th look) concerning the default page setting in GA.

        Thanks again.
        _Cindy

        1 Reply Last reply Reply Quote 0
        • ThompsonPaul
          ThompsonPaul last edited by Sep 14, 2016, 1:57 PM Sep 14, 2016, 1:55 PM

          Cindy, this is almost certainly an issue with the way your Google Analytics is configured, not your WP site. (the fact the "index.htm" comes after a "/" is the clue.

          If you check the View Settings link under the View in the Admin section of your dashboard, you'll find a field called Default Page. For most correctly configured modern sites (WP sites included), this field must be empty for GA to be configured correctly. I'm betting your config has index.htm entered in that field. [See screenshot below.]

          Once you remove that entry, your data will avoid the problem going forward, but it will take some work with custom filters if you want to try to clean up the historical data.

          Let me know if that solves the issue?

          Paul

          rOLe0

          cceebar 1 Reply Last reply Sep 14, 2016, 2:26 PM Reply Quote 0
          • ThomasHarvey
            ThomasHarvey @cceebar last edited by Sep 13, 2016, 6:03 PM Sep 13, 2016, 6:03 PM

            Are you able to copy out your whole htaccess?

            I've got to admit, i'm not the best with it but I'll try and help you figure this out 🙂

            cceebar 1 Reply Last reply Sep 14, 2016, 2:05 PM Reply Quote 0
            • cceebar
              cceebar @ThomasHarvey last edited by Sep 13, 2016, 5:27 PM Sep 13, 2016, 5:24 PM

              Hi Thomas,

              Very much appreciate your reponse.

              So far none of the redirects are working, including your suggestion. So I tested the htaccess file with this redirect, changing one of the redirects already listed in the htaccess file for some time now, which use to work...

              RewriteCond %{HTTP_HOST} ^dupontservicecenter.com/buying-and-selling$
                  RewriteRule ^$ http://dupontservicecenter.com/rewards/auto-service-credit [L,R=301]

              ...not working, is redirecting to the old url, the one I changed.

              I have purged cache (using litespeed cache for wp since I'm on a litespeed server these days). Could it be a purge issue? What would cause the htaccess file not to work properly?

              The only redirect that is working is through a plugin for wp - quick redirects which uses the wp_redirect() function.

              Totally lost in a haystack.

              Any further suggestions would be helpful, otherwise, a complete, timely, breakdown of all website components will have to be proposed to the client.

              _Cindy

              ThomasHarvey 1 Reply Last reply Sep 13, 2016, 6:03 PM Reply Quote 0
              • ThomasHarvey
                ThomasHarvey last edited by Sep 12, 2016, 1:16 PM Sep 12, 2016, 1:16 PM

                https://moz.com/community/q/redirecting-index-html-to-the-root

                StreamlineMetrics:

                If you want to redirect all index.html(s) to their roots, then try this code -

                RewriteEngine On
                RewriteRule ^index.html$ / [R=301,L]
                RewriteRule ^(.*)/index.html$ /$1/ [R=301,L]

                And yes, Google will treat them as 301 redirects so your juice will be transferred and consolidated.


                Obviously, change index.html to index.htm

                cceebar 1 Reply Last reply Sep 13, 2016, 5:24 PM Reply Quote 0
                • 1 / 1
                1 out of 7
                • First post
                  1/7
                  Last post

                Got a burning SEO question?

                Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.


                Start my free trial


                Browse Questions

                Explore more categories

                • Moz Tools

                  Chat with the community about the Moz tools.

                • SEO Tactics

                  Discuss the SEO process with fellow marketers

                • Community

                  Discuss industry events, jobs, and news!

                • Digital Marketing

                  Chat about tactics outside of SEO

                • Research & Trends

                  Dive into research and trends in the search industry.

                • Support

                  Connect on product support and feature requests.

                • See all categories

                Related Questions

                • brettmandoes

                  How to Diagnose "Crawled - Currently Not Indexed" in Google Search Console

                  The new Google Search Console gives a ton of information about which pages were excluded and why, but one that I'm struggling with is "crawled - currently not indexed". I have some clients that have fallen into this pit and I've identified one reason why it's occurring on some of them - they have multiple websites covering the same information (local businesses) - but others I'm completely flummoxed. Does anyone have any experience figuring this one out?

                  Reporting & Analytics | Jul 16, 2022, 11:21 PM | brettmandoes
                  2
                • Sayers

                  Redirecting one domain to another using utm tags

                  I have two live websites, which have both been live for over 10 years, so we have plenty of backlinks to both...domain1.com & domain2.com. Domain 1 and all urls is being merged into domain2.com. So 301 redirects will be setup for every page of the site....domain1.com/abc-1234/ to > domain2.com/abc-1234/ In Google analytics for domain2.com we want to be able to see which visits we have received as a result of a redirect from domain1.com. It is possible to see these visits that come in via organic, referrals and social etc, as those will come to us with the referral as domain1.com. However, with direct traffic, i.e. if someone types domain1.com into their search bar, these visits will be assigned as direct and we are not able to tell in GA if those users have typed in domain2.com, or domain1.com to get to our webpage. There are some suggestions in forums of adding utm_source tracking to all redirects (and add canonicals to those urls pointing to the non utm_source version), but my concern is that Google is going to have to go through one extra step to reach the page on the redirected domain. So without the utm source code Google will follow this route
                  domain1.com/123/ to domain2.com/123/ With the utm source code Google will follow this route
                  domain.com/123/ to domain2.com/123/?utm_source... then see's canonical, so moves to domain2.com/123/ So essentially I am giving Google one extra step to follow before it gets to the equivalent page on the new site. Is this an issue, and/or are there any other ways to track this redirection without adding extra parameters to the url?

                  Reporting & Analytics | Jan 23, 2017, 7:55 AM | Sayers
                  0
                • raghuvinder

                  Www.googleadservices.com/pagead/conversion_async.js what is this url doing on my site?

                  Hello Guys, I am using google tagmanager and i have configured adwords in tag manager now what i find is that this link - www.googleadservices.com/pagead/conversion_async.js showing on my homepage not in view source but when i do inspect element at that time it appears. So do you think after using google tag manager still i need to use the given link? Thanks, Raghu

                  Reporting & Analytics | Jun 18, 2015, 6:53 PM | raghuvinder
                  0
                • CoGri

                  Migrated website but Google Analytics still displays old URL's and none new?!

                  I migrated a website from a .aspx to a .php and hence had to 301 all the old urls to the new php ones. It's been months after and I'm not seeing any of the php pages showing results but I'm still getting results from the old .aspx pages. Has any one had any experience with this issue or knows what to do? Many thanks,

                  Reporting & Analytics | Jun 3, 2015, 10:08 AM | CoGri
                  0
                • marketingmediamanagement

                  How to get multiple pages to appear under main url in search - photo attached

                  How do you get a site to have an organized site map under the main url when it is searched as in the example photo? SIte-map.png

                  Reporting & Analytics | Mar 24, 2015, 7:49 PM | marketingmediamanagement
                  0
                • CFSSEO

                  Parenthesis in URL?

                  For some reason, we have some URLs on our site with parentheses in them such as somesite.com/used-this(that)What will parenthesis do to the ranking of those pages?

                  Reporting & Analytics | Mar 9, 2015, 8:53 PM | CFSSEO
                  0
                • Kingalan1

                  Sudden Increase In Number of Pages Indexed By Google Webmaster When No New Pages Added

                  Greetings MOZ Community: On June 14th Google Webmaster tools indicated an increase in the number of indexed pages, going from 676 to 851 pages. New  pages had been added to the domain in the previous month. The number of pages blocked by robots increased at that time from 332 (June 1st) to 551 June 22nd), yet the number of indexed pages still increased to 851. The following changes occurred between June 5th and June 15th: -A new redesigned version of the site was launched on June 4th, with some links to social media and blog removed on some pages, but with no new URLs added. The design platform was and is Wordpress. -Google GTM code was added to the site. -An exception was made by our hosting company to ModSecurity on our server (for i-frames) to allow GTM to function. In the last ten days my web traffic has decline about 15%, however the quality of traffic has declined enormously and the number of new inquiries we get is off by around 65%. Click through rates have declined from about 2.55 pages to about 2 pages. Obviously this is not a good situation. My SEO provider, a reputable firm endorsed by MOZ, believes the extra 175 pages indexed by Google, pages that do not offer much content, may be causing the ranking decline. My developer is examining the issue. They think there may be some tie in with the installation of GTM. They are noticing an additional issue, the sites Contact Us form will not work if the GTM script is enabled. They find it curious that both issues occurred around the same time. Our domain is www.nyc-officespace-leader. Does anyone have any idea why these extra pages are appearing and how they can be removed? Anyone have experience with GTM causing issues with this? Thanks everyone!!!
                  Alan

                  Reporting & Analytics | Jun 26, 2014, 2:43 PM | Kingalan1
                  1
                • jimmy0225

                  Godaddy 301 redirect

                  Hi, Happy Holidays to all!  Although, this is not Thanksgiving, I am very thankful for becoming a member of this site.  I ahve learned so much. Here is yet another question hping to have answered by the pundits of this SEOMOZ: I have a site built on site builder and hosted on Yahoo Hosting which does not allow 301 Redirects; I was fortunate enough to have someone help opn this site explain to me how to use Godaddy (they are my domain provide) to 301 through forwarding, work great! My http://domain.com now directs to www.domain.com , the only problem I am having now is, on :sitebuilder" the index page is classified as index.html, thus providing duplicate content again.  Can you do two redirects through Godaddy?  In othert words, my http://domain.com/ goes to www.domain.com/ eliminating duplicent content, but now I have another URL - http:..domain.com/index.html how do i get rid of that to prevent dup content. Any feed back would be great, Happy Holidays! Jimmy

                  Reporting & Analytics | Dec 25, 2012, 7:06 PM | jimmy0225
                  0

                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
                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 - 2025 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
                • Accessibility
                • Terms of Use
                • Privacy

                Looks like your connection to Moz was lost, please wait while we try to reconnect.