Redirecting all URLs appended with index.htm or index.html
-
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
-
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
-
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.
-
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?
-
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?
-
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
-
-
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 -
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
-
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
-
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
-
https://mza.bundledseo.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
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.
Related Questions
-
How often does the indexing take place?
Hi there, I am currently looking at one of my campaigns and have noticed that since i last checked on the 31st Jan there have been no change in analytics despite me having done work on the campaign itself. I saw in the external links section that it said "38 down since last index" and I was just wondering how often the index takes place. Any help with this would be greatly appreciated! Many thanks.
Reporting & Analytics | | VoodooCreativeLtd0 -
How can I remove parameters from the GSC URL blocking tool?
Hello Mozzers My client's previous SEO company went ahead and blindly blocked a number of parameters using the GSC URL blocking tool. This has now caused Google to stop crawling many pages on my client's website and I am not sure how to remove these blocked parameters so that they can be crawled and reindexed by Google. The crawl setting is set to "Let Google bot decide" but still there has been a drop in the number of pages being crawled. Can someone please share their experience and help me delete these blocked parameters from GSC's URL blocking tool. Thank you Mozzers!
Reporting & Analytics | | Vsood0 -
URL Structure for Study Guides
I'm creating study guides for various musicals, plays and operas. A few issues: I want to easily view in Google Analytics data for all study guides, data at the category level (musical,play, opera) and data for an individual show. I want urls to be as short as possible for usability purposes. Some show titles are the same for shows in different categories. For example, there is the play Romeo and Juliet but there is also an opera Romeo and Juliet. Each study guide contains multiple sections that will live on different URLs (overview, context, plot summary, characters) What would be the ideal URL structure? Here's what I was currently thinking we should use: /show/play/romeo-juliet/ /show/play/romeo-juliet/context /show/play/romeo-juliet/plot /show/play/romeo-juliet/characters
Reporting & Analytics | | stageagent0 -
Page Views for a List of URL's (Excel & Analytics)
I've been playing around with a few excel plugins trying to get the visit count for over 350 different URL's on the same website. I cant seem to find a function that can do this. Can anyone advise a work around or a way i can achieve this? Greg
Reporting & Analytics | | AndreVanKets0 -
301 Redirect tracking
Hi All, I have a 301 redirect tracking issue. I have a domain, say www.123.co.uk and I have that domain 301 redirecting to www.abc.co.uk. Looking in analytics, I do not see any referral traffic sources for the redirect i.e. I do not see www.123.co.uk as a referral (and I know it does sent traffic). My question is - how can I implement a solution that will show referral traffic from www.123.co.uk to www.abc.co.uk as a referal in analytics? Hope that makes sense?
Reporting & Analytics | | Webrevolve0 -
How to set up a 301 redirect
I have just started using SEOmoz and found that we have both a www.adagiowaterfeatures.com site and a adagiowaterfeatures.com site. I have not been able to figure out how to set up the 301 redirect so the non-www site automatically goes to the www site. If anyone can tell me how the non-www site was set up to begin with I'd be interested. We only set up one site. Thanks!
Reporting & Analytics | | AdagioWaterFeatures0 -
When i first add my url to seomoz then i had a general report of all the faults my website had in SEO and suggestions where can i find it now , i cant find it ?!
when i first add my url to seomoz then i had a general report of all the faults my website had in SEO and suggestions where can i find it now , i cant find it ?!
Reporting & Analytics | | fireproductsuk0 -
Webmaster Not found URLs
Dear All, I would really like help with this. Due to some unknown reason (another thread is open for this reason), my google webmaster is showing 7000 not found URL's. Now, when i try to find out the day these broken URLs were detected, webmaster is showing dates between November 2011 to December 2nd, 2011. I havent found a single not found error showing after 2nd December 2011. So does that mean that the mistake has been solved? Because daily webmaster is adding 200-300 not found URLs. Along with this, my traffic has dropped drastically since 12th December and has still not recovered. Are these not found URLs the reason for this sudden traffic drop? If so, then i m ready to find someone for paid seo to remove this error. I would love to have some concrete answers for these questions. Thanksss
Reporting & Analytics | | hith2340