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 find the pages in the site which is ranking for zero keyword
I have around three thousand pages in my website,how to find the list of pages which is ranking for zero keywords
Moz Bar | | srinivasan.n1 -
Changed Domains and Internal Links haven't followed, Old Domain redirects to new domain
On our domain residentiallandlord.com we are a little confused on the Compare Link Profiles option,I'm wondering if you can helpWe changed our domain a few years back and have our old domain redirected to our new domain.On our new domain we have only internal links visible, https://residentiallandlord.com/wp-content/uploads/2018/06/moz-rl.com.pngbut if you look at our old domain, which goes to our new domain it has loads of internal links, even though there is no physical site on this domain as it redirects to our new one, https://residentiallandlord.com/wp-content/uploads/2018/06/moz-rl.co.uk.png Can you help me understand why no internal links are showing for the new domain and how to fix this.
Moz Bar | | karlh19740 -
Keyword used 2389 times in page
in the "on page grader" tool I get that the keyword appears 2389 times. I'ave searched for it in the developer console, thinking it might be due to invalid HTML - but the number it's appearance is no near to 2389. Can any one help me figure out why is this so? the page is http://naamanewman.co.il/photosGalleryID.aspx?id=34
Moz Bar | | digitalalchemy
keyword "שמלות כלה נפוחות" (hebrew) QDQW4xw.png0 -
Moz is finding phantom pages
I suddenly have 4xx errors in my crawl diagnostics because pages with “/%3C/div” added to the end of the URL that are linked from the normal page can't be found. I didn't create the pages, and they don't exist, but Moz thinks that they do. I went back through to see if any changes in WordPress, theme or plugins versions might be the cause, but this is the only site that I have this issue, so I don't think that is it. Does anyone have an idea what causes this?
Moz Bar | | samuelldrew0 -
Comparing Competitor On-Page Grades?
When I run an advanced SERP report or even the basic keyword difficultly report it gives me competitor On-page grades. I can look directly at their code, but I'm wondering if there is a way to easily see and export a .csv or excel file of the on-page ranking factors for the top 1-10 results comparing them to a page on my site? Seems like that would be really helpful and much quicker than looking at source code to understand what on-page factors are contributing to their success. Is there any way to do this in Moz or a free tool elsewhere you would suggest?
Moz Bar | | K-WINTER0 -
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 -
Is there a tool that works like crawl test that allows more than 3000 pages?
I enjoy using crawl test inside moz but I need to find a way to crawl all the pages on a site. It would probably be in the neighborhood of 10,000 urls. Does anyone know of a free tool and if not is there a paid tool that will do this?
Moz Bar | | bradwayland0 -
"WWW." versus Non - "www."
Our web developer recently changed our preferred domain from "www.thinkbiglearnsmart.com" to "thinkbiglearnsmart.com" so when I check the authority of the "www." it is higher than the "thinkbiglearnsmart.com." do you have any insight onto if we should just make our preferred URL "www." because that's how it was for years? Is there a way just to merge the two back together so it is not sort of having different information for the same site? Thank you!
Moz Bar | | thinkbiglearnsmart0