Calling all 301 htaccess Guru's - www to non www - then to https + Redirect homepage to inner page
-
I have tried searching, multiple opinions and multiple things that supposedly work.
What I have now, seems to work from an end user perspective, but Roger tells me otherwise: Redirect Chain issue....redirect, which redirects which redirects etc.....
FIRST, we need to redirect all www to non www.
SECOND, we need to redirect all to https.
THIRD, we need to redirect the homepage to an inner page. (Got to love BOGUS DMCA complaints! :)?)
So far we have:
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} ^mydomain.com.au$ [OR]
RewriteCond %{HTTP_HOST} ^www.mydomain.com.au$
RewriteRule ^/?$ "https://mydomain.com.au/inner-page-here" [R=301,L]Plus down the page there is the usual wordpress settings:
<ifmodule mod_rewrite.c="">RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]</ifmodule>So, why does it seem to work for the end user, but Roger has his knickers in a knot saying, redirect, to redirect to redirect etc?
Namaste and many thank you's in advance
-
Haha it certainly does! Thanks for keeping me updated
-
All good, thanks for your help
Just realised too, we have put a plugin in place to redirect all 404's to a sitemap page....probably the 3 step redirect issue Moz is picking up on....got to love this stuff. Always keeps you on your toes.
-
Hi Eli,
Thank you for your response.
You actually pointed out a specific redirect that was in place, but what we were redirecting didn't exist i.e 301 redirect /tag/ThisExists-ButThisTypoDoesnt - do you think that would be the cause? Although, if the tag/post didn't exist how did Roger pick it up, through htaccess?
We are in the process of redirecting our /tag and /category posts to more appropriate pages. I will re-crawl and see if the same issue pops up fingers crossed.
-
I would normally advise that you speak to a web developer for a question like this. Perhaps something else on the forum who reads this question will be able to advise?
Unfortunately I am not able to help out with the code in this situation, sorry about that!
Eli
-
Found this, but I do not know if both portions need to be added or one....any thoughts?
To redirect www to non-www
RewriteCond %{HTTP_HOST} ^www.your_domain.com$
RewriteRule ^(.*)$ http://your_domain.com/$1 [R=301]To redirect www to non-www (while using SSL)
RewriteCond %{HTTP_HOST} ^www.your_domain.com$
RewriteCond %{SERVER_PORT} ^443
RewriteRule ^(.*)$ https://your_domain.com/$1 [R=301]So... would both be needed, and what would the additional part be to redirect home to an inner page?
Thank you in advance!
-
Hey!
Thanks for reaching out to us!
When we point out a redirect chain, the idea is to reduce the number of redirects in total.
Let's say you had three URLs - URL A, B and C. URL A redirects to URL B, which redirects again to URL C. You'd want to remove the redirects for URL B in the middle, so that URL redirects straight to URL C.
I've had a look at your Campaign and one of the redirect chain's we are flagging up: https://www.screencast.com/t/kHnwGBcdvb (I used a third party tool - https://httpstatus.io/ ) - As you can see there are 3 redirects in place, would it be possible to cut it down to just one redirect? This minimises moving parts and would fix that redirect chain.
Of course, it's best to check with your website administrator that this is the best move in your case, as each site is completely different.
Unfortunately I am not a web developer so cannot advise on the code within your page, just the tools we provide
Feel free to write in to help@moz.com if you would like to follow up with any specific questions!
Thanks!
Eli
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
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 to export to csv all top pages links in link explorer?
When i press export to csv it does not offer to choose how many rows but exports to file only 500 rows. But there is more than 3000. How to export all rows? Thanks
Moz Bar | | AndrisZigurs0 -
Site crawl only shows homepage
Hi everyone, A client of us has a quite new website with a lot of URLs. (Google Search Console indicates around 5300.) However, when I execute a site crawl with screaming frog, or a crawl test in MOZ, it only shows me one URL, the homepage. Does somebody have an idea why the other pages of the website are not showing up? Thanks,
Moz Bar | | WeAreDigital_BE
Jens0 -
I'm getting an error when I try to preview my custom report
I'm getting the following error when I attempt to preview my custom report. I have also attached a screenshot. The moz.com page isn’t working moz.com sent an invalid response. ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITIONI need to send my client his report for a meeting tomorrow morning, and I am unable to run it. The campaign is propacusa.comf3VhmfU
Moz Bar | | chill9860 -
Why RogerBot can't crawl site https://unplag.com
Hello Please help me to solve the problem. The on-page grader and Crawl Test are not working for Unplag.com website. Both said that they can't access the url. Yes, I've tried different variants like unplag.com, http://unplag.com One more thing - RogerBot was disallowed in robots.txt file. I deleted it from the file a week ago so maybe moz index haven't been renewed.
Moz Bar | | Targeras0 -
Www.site.com linking to pages www10.site.com
The root domain of the website in question is www.site.com but all subpages are on the subdomain www10.site.com (I'm pretty sure it's a subdomain, at least, used for load balancing?). A funny thing happens on this site with the moz toolbar. I visit a subpage, www10.site.com/articles/articletopic1 That page has a lot of links on it, all of them visibly going to the subdomain www10.site.com. However, the moz toolbar shows some of them as Internal links and most of them as External links. As far as I can tell, there is no real rhyme or reason to the difference between the links that are highlighted as Internal vs. External. The link structures vary greatly: Some are properly structured www10.site.com/blogs/category
Moz Bar | | Motava
And some are poor like www10.site.com/articles/show_articles.php?section=category1 So a couple questions here: Does this subdomain www10 have a detriment on the rankings of subpages?
What could possibly cause the internal links on these subpages to be highlighted as external pages with the moz toolbar?1 -
Duplicate Page Title query in the PRO Campaign tool
Can someone help me on this. I am seeing duplicate page titles on the PRO Campaign Crawl tool on an ecommerce site for example MOZ is saying that these two pages have a duplicate page title: http://www.cheapsnapframes.co.uk/colour-25mm-snap-frames/25mm-green-snap-frame/a0-traffic-green-snap-frame-25mm/prod_1730.html http://www.cheapsnapframes.co.uk/snap-picture-poster-frames/colour-25mm-snap-frames/green-25mm-snap-frame/a0-traffic-green-snap-frame-25mm/prod_1730.html They are the the same product in two categories. When I view the source of both pages the this link is the same in the meta: <link rel="<a class="attribute-value">canonical</a>" href="[http://www.cheapsnapframes.co.uk/colour-25mm-snap-frames/25mm-green-snap-frame/a0-traffic-green-snap-frame-25mm/prod_1730.html](view-source:http://www.cheapsnapframes.co.uk/colour-25mm-snap-frames/25mm-green-snap-frame/a0-traffic-green-snap-frame-25mm/prod_1730.html)" /> So is there something else I need to have done to erradicate this or is it not an issue? Thanks in advance Tracy
Moz Bar | | dashesndots0 -
Rank Tracker page shows only first 50 entries
On the Rank Tracker tool page, http://moz.com/researchtools/rank-tracker, when I hit the Next 25 it works the first time but none of the others. Trying to run a report and since we have more than 50 keywords I have to manually click on them to be checked.
Moz Bar | | HopeIndu0 -
Moz ranking report shows massive loss in Bing SERP's. But it is not the case?
My weekly ranking report shows massive loss of SERP's on Bing. For most keywords I was no longer in the top 50 which where first top 5. But when I checked it out for myself, I'm still ranked top 5 for these keywords. I then used the Moz Rank Tracker and there it also says I'm still ranking top 5 for these keywords. What should I believe now?
Moz Bar | | wellnesswooz0