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
-
Should keywords found in a keyword tool (eg. Keyword explorer) be implemented on a page in the exact order?
Hi guys, I have a question about adding keywords found directly from a keyword tool onto a webpage. I see a keyword opportunity from Moz's Keyword Explorer, for example, "dog giardia treatment natural" and was wondering if it should be worked into the page exactly in that order? For example, I've modified the question on the page to now read "Are there any other dog Giardia treatments that are natural?" Is this good practice? Should it be exactly in the order of the keyword found in the tool? Is what I've done too spammy? Appreciate any help! Thanks
Moz Bar | | marktheshark101 -
Is the Moz on-page grader going to start grading mobile-first as Google does?
I wonder whether this has been taken into account yet or there are any plans to in future.
Moz Bar | | mybuilder1 -
Why does the moz crawl test lists page twice?
Hi, I'm running into an issue where some crawlers list my pages twice, once with a trailing slash, once without. I first saw it on a few pages with screaming frog, then saw it happen on all my pages with the moz crawler. The site is www.kidsandart.org and its on Squarespace. I grepped the sitemap.xml I submitted to google webmaster and got 167 distinct pages, all of them without a trailing slash. Any insights on why this is happening, and how to regard moz crawler results would be appreciated. thanks Tom
Moz Bar | | tpushpathadam0 -
Multiple Page Title Elements
I have searched high and low for the source of this but just cannot find it. On-page grader gives the multiple page title elements warning, but I just can't identify where this is coming from. Can anyone, please, point me to the right direction?
Moz Bar | | Roselawn0 -
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 -
My 301 Error and Duplicate Title Content Issue is Growing !
When i redirect some of my page - it shows error. not redirecting and i made this 3-4 months before, no effect. All Errors under each category make me gone sick.
Moz Bar | | Esaky0 -
How do you stop Moz crawling a page?
Hello, I have a contact form which generates thousands of duplicate crawl errors. I'm going to use to block Google indexing these pages. Will this also block MOZ from crawling these pages and displaying the error? Thanks!
Moz Bar | | Seaward-Group0 -
On-Page Grader Levels
I see that On-Page Grader reports include a numerical number such as the following: Keyword Usage for audio book gift certificates = 15 I improved this page (http://www.audiobooksonline.com/audio-book-audiobook-gift-certificates.html) from 3 to 15 today. What is the maximum "grade" possible?
Moz Bar | | lbohen0