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
-
Issues with Page Grader using Wordpress / Visual Composer?
HI I know there is a flagged issue with page titles on the Visual Composer - but it is telling me there is no test on one page completely even though there is?? And it works on the others?
Moz Bar | | KellyDSD860 -
Is the Content Suggestions section under Page Optimization a TF-IDF Analysis?
If you start a campaign in Moz, go to page optimization, enter a URL and keyword, and go to the bottom where it says "Content Suggestions" is that basically do a TF-IDF analysis? I want to make sure I understand how that works. Thanks!
Moz Bar | | brettmandoes0 -
Moz says "Title Too Long", Yoast says title is the perfect length. Who's right?
For a bunch of my pages, the MOZ Crawl Report says "Title Too Long". Yoast on my site tells me that the titles are the correct length. How can these two things be at odds with each other? Which one is right?
Moz Bar | | TeamViviRealEstate0 -
Performed a Moz Crawl Test - Says I have 107 External Links on Homepage??
Hello Mozzers! Exactly at the title suggests, I performed a crawl test on one our sites and the report says we have 107 external links on the homepage and another 34 on one of our internal category pages. On both of these pages I can only find 7 external links, anyone know why the crawl test is saying this? And if Moz is finding these external links could google be doing the same and punishing our site for the high number of external links? Any response appreciated! Richard
Moz Bar | | Richard-Kitmondo0 -
301/302 header
Hi,
Moz Bar | | 12tix
I changed from http to https with SSL certificate and have added the following code in my htaccess: RewriteEngine On
RewriteCond %{HTTPS} !^on$
RewriteRule (.*) https://www.mysitesurl.com/$1 [R,L] RewriteCond %{HTTP_HOST} !^www.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] But Moz returns a:
Temporary Redirect
Using HTTP header refreshes, 302, 303, or 307 redirects will cause search engine crawlers to treat the redirect as temporary and not pass any link equity to other pages. We highly recommend that you replace temporary redirects with 301 redirect And additional header checkers return a 302 also when I check http://www.mysitesurl.com/:
HTTP/1.1 302 Found =>
Date => Tue, 05 May 2015 09:31:18 GMT
Server => Apache/2
Location => https://www.mysitesurl.com/
Content-Length => 214
Connection => close
Content-Type => text/html; charset=iso-8859-1 Anybody an idea why there is no 301 result? Thanks1 -
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 -
How does an index page have a higher Authority than the root domain?
So just curious, but on my domain, http://www.bulwarkpestcontrol.com the Page Authority is 59 and the root domain authority 52. That seems odd as it is the same page. Explanation?
Moz Bar | | Thos0030 -
Is there a way to get Page Authority values included in the Crawl Diagnostic .csv export?
Would be nice to have these values included so that you can sort by Page Authority. 4uF6efx.png
Moz Bar | | WebReputationBuilders0