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 -
Cannot crawl website with redirect intalled on subdomain url
Hi! I want to crawl this website : http://www.car-moderne.ch. I tried a got back the crawl just for that one url (not for all the pages of the website). This single line cvs says that the status of the http://www.car-moderne.ch is 200, but in fact it is a redirect 301 to http://www.car-moderne.ch/fr where the live home page is (actually the Moz bar sees the 301, not the 200 as the single-lined crawl does). How can I proceed in this case (a 301 redirect being installed on the subdomain url) to still be able to have a full-fledged juicy cvs with all the broken links, duplicate content, etc. Thank you for your help! Pascal Hämmerli
Moz Bar | | Ethos_Digital0 -
Puzzled. High domain authority, but low page authority?
I have a question regarding how a page's authority can be low but the domain authority be high. I'm using the SERP report in moz to compare competing pages. The page I'm working on is an ecommerce category page. Moz says it has very low page authority, has been indexed for a little over a year, it's domain authority is a moderate 50, and has no root domains linking to it. It is more relevant than the other pages (has more products for sale that fit the keyword searched for), has a decent amount of copy on the page, but ranks around #10 in the search results. The competing pages are also ecommerce category pages. The 9 ranking higher have domain authority varying from 30-75, and 1 or 2 root domain links to them. Their number of products that match the keyword searched are all over the board, some have many matches, some have only 6 or 8 results. Some have a moderate amount of text on the page, some have very little text on the page. Yet they have page authority in the 30s-40s. What goes into page authority that I'm missing which would make these other pages have so much more authority when they are just slightly better in the other metrics listed above? What am I missing here?
Moz Bar | | K-WINTER0 -
Why isn't the Moz bar data populating for Yahoo sites?
The Moz bar isn't populating information for Yahoo homepage or it's verticals (i.e. homes, autos, finance, etc.), but I can get this data for other portals like AOL or MSN. I'm specifically looking for PA, mR, and DA information, but instead I get a generic "Search Profile" bar with no page/site-specific data.
Moz Bar | | AllieBell
Is there a reason Open Site Explorer data isn't populating for this particular portal?0 -
Why do my search results differ from MOZ's rank tracker
This is starting to happen a lot, i mean they weren't always an exact match but they differed by a few places. But now the gap between results I'm getting and MOZ's own rank tracker is quite large. For my keyword my page ranks on MOZ at 39 (it was 25 but has slipped down). Im seeing my page on page 1 locally and page 2 in incognito mode. Now I understand there are other factors such as browser history, cookies, am i logged into gmail etc. Thats why I asked colleagues to use Internet explorer and they have nothing to do with SEO so their history wont affect the search. They report seeing it on page 2, even colleagues in a different office in a different city sees it on page 2. I want to contact the department in question and share the good news that they've gone from none existent to 14th in what is a very competitive area. But MOZ's result has be second guessing whether I should. Any ideas why the gap between results is so large? Thanks
Moz Bar | | Brabian0 -
Moz crawler finding my homepage multiple times
Hi and thank you in advance for your help! I have a Moz Pro campaign running (I am a complete Moz novice by the way) for one of my websites (balloonsutah.com). After crawling my site, the Moz crawler informed me that I have 3 pages with duplicate content. While I am not sure why exactly this is happening, the crawler indexed my homepage 3 times under different url's. -balloonsutah.com
Moz Bar | | Keenan-Price
-balloonsutah.com/
-balloonsutah.com/index.html I checked my FTP server and I cannot figure out for the life of me why the crawler is finding anything other than the index.html file. I suppose I need to do something regarding a rel="Canonical" but I am not terribly familiar with that either. Any suggestions would be greatly appreciated!
Keenan0 -
Moz crawl suddenly shows much less pages from what I really have
Hi! Moz crawl suddenly shows much less pages from what I really have and from what they used to show after completing the crawl. Should I be worried? What could that be? Regards, Yossey
Moz Bar | | Joseph-Green-SEO1 -
On Page Grade - Moz Analytics
When I go to search overview I can see my on page optimization grades, but when I try to use the on page grade optimizer for different keywords and url's I get the error. "The URL you entered does not appear to be returning a page successfully. Please make sure that you've entered the URL of valid, working page." However, I know it is a valid url and I get the error even if I use the same url and same keyword I can see the grade for from the search overview. Also, if I try to regrade the page nothing happens and where my previous grade and analysis was located I now have nothing. Any information about why this is happening? Thanks for the help.
Moz Bar | | ZeroWing0