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
-
Dynamic URL parameter generator
Hi Is any one privy to an online tool that will let me create a dynamic URL parameter string but will allow me to generate multiples of the URL and add a distinct key for each one. E.g Campaign Source, Medium, Name, a Keywords etc. are all the same in the string but then I want to generate a unique id code at the end. Then export them as a csv and integrate into my database lists. Looking to run this into a few thousand as well. I was going to just do this in Excel and combine two columns withe the string and the number count in the other column but if there is a tool that does it all that would be interesting to know.
Reporting & Analytics | | David-E-Carey0 -
Tracking sessions from a sub-domain that is 301 redirected to main domain
Hi, one of my client is launching a new site on a subdomain newsite.brand.com.au but will use a shorter URL on the packaging on their new rang of products to be sold in supermarkets, prompting shoppers to visit xxx.brand.com.au. This specific sub-domain xxx.brand.com.au will be 301 redirecting to newsite.brand.com.au How can I identify and track accurrately all the visits coming from xxx.brand.com.au to newsite.brand.com.au?The visits from sub-domain xxx.brand.com.au will be attributed to direct channel I guess. Is it worth adding GA on this 301 redirected sub-domain xxx.brand.com.au or there another way to identify those visits on newsite.brand.com.au ?
Reporting & Analytics | | mecglobal0 -
Virtual Pageviews vs. Destination URL for Goal tracking
I am working on setting up goal tracking. Currently when we receive a new signup, the person gets sent to their dashboard homepage and this is not a valuable a goal tracking destination. My suggestion was to build a "Welcome" interstitial page to send a user to when they create an account. Our tech team suggested using a Virtual pageview instead as it is their thinking that a "Welcome" page adds little value. Is there any downside to using Virtual Pageviews with regards to goal tracking?
Reporting & Analytics | | Vacatia_SEO
Are interstitial page more reliable?
Can you still use funnel visualization with Virtual Pageviews?0 -
Which one should I be using 301 redirects
Hiya guys, I have a little problem, not sure which one I should be using, for 301, be easy on me I've not dealt with this before. So we have http://www.talknightlife.co.uk and I've done redirects for http://talknightlife.co.uk to http://www.talknightlife.co.uk host http://www.talknightlife.sheffieldspeedcameras.co.uk to http://www.talknightlife.co.uk Because my website is purely a forum and in the canonical error from the optimisation tool is showing 301 canonical = http://www.talknightlife.co.uk/forum.php should I be redirecting that to http://www.talknightlife.co.uk or the other way round, or just leave it ? I'm a little confused Cheers in advanced for your help guys
Reporting & Analytics | | Lukescotty0 -
No Link Data Available for this URL appears often. Are my sites too small to show up?
I am on the trial until Mar 5, 2012. I seldom get the info I want. Is it because my sites are too narrow a niche? I don't seem to be getting the data I'd like from your service. I'm trying to like it, but when I keep getting messages like this, it makes it hard to justify: "No Link Data Available for this URL appears often" Sample sites that I am unable to get data. I especially would like to know how many backlinks exist for each site. I paid someone to help me with them and I'd like to verify their work.: http://costaricadentistreview.com/ http://costaricadentistreviews.com/ http://costaricadentalimplants.org Any suggestions? Thanx Kurt Gross
Reporting & Analytics | | kurtray0 -
How to change a url for google analytics account
We recently changed the url of a client's website. Is there a way to change the url on the ga account instead of creating a new account so that we don't lose comparative data? Thanks! Sorry- I know this is a novice question.
Reporting & Analytics | | marketing12340 -
Historical Indexation
Hello, Is there at tool to see how many pages were indexed in google for a particular website historically? Thanks
Reporting & Analytics | | soeren.hofmayer0