301/302 header
-
Hi,
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 redirectAnd 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-1Anybody an idea why there is no 301 result?
Thanks
-
Perfect, glad it helped!
-
Hi Matt,
Thanks for that, have changed the code as you advised to:
RewriteEngine On
RewriteCond %{HTTPS} !^on$
RewriteRule (.*) https://www.mysitesurl.com/$1 [R**=301**,L]RewriteCond %{HTTP_HOST} !^www.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]and it seems to work!
HTTP/1.1 301 Moved Permanently =>
Date => Tue, 05 May 2015 12:07:49 GMT
Server => Apache/2
Location => https://www.mysitesurl.com/
Content-Length => 238
Connection => close
Content-Type => text/html; charset=iso-8859-1Thanks a bunch!!!
-
Ok thanks for the PM. I see the issue now - didn't need the URL after all, just a few more minutes to process.
The redirect is matching the first rule. You only have R,L so R by itself defaults to 302. It's picking up that before the other rule so it stops processing.
Set the top rule to R=301 and make sure you see a true 301 after that. If not, I'm wrong. haha But I think that's it.
-
Going to need the actual URL I think. If you can't post here, PM it - but I don't see the issue.
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
-
What does "Optimal Use of Keywords in Header Tags" really mean?
I get this explanation on the grader: Although using targeted keywords in H1 tags on your page does not directly correlate to high rankings, it does appear to provide some slight value. It's also considered a best practice for accessibility and helps potential visitors determine your page's content, so we recommend it. Over-using keywords, however, can be perceived as keyword stuffing (a form of search engine spam) and can negatively impact rankings, so use keywords in H1 tags two or fewer times. To adhere to best practices in Google News and Bing News, headlines should contain the relevant keyword target and be treated with the same importance as title tags. But I have the keyword in an H1 tag, only once. So why am getting this message on the grader? The URL is https://www.armsecuritysystems.com/business-security-systems/ The keyword is "business security systems" Any insight would be greatly appreciated.
Moz Bar | | bizmarquee1 -
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 -
Top pages according Link Explorer shows 301 pages and images
I was looking at the top pages on my website using Link Explorer, it contains 301 pages and image URLs. Is this expected or I should be doing something to fix it? URL with second highest PA in site is a page already 301 redirected more than 6 months back. URL with highest PA in my blog is a random image in the blog, rather than any blog posts. Is this normal? Thanks -Aji
Moz Bar | | ajiabs1 -
Www and non www / duplicate content / redirects / www resolve issue
I am not getting docked for these specific errors, but I am getting docked for 1 page has a WWW resolve issue and 1 wrong URL in the sitemap... (SEM Rush) but when I use moz, it's not showing any issues. So I have these things set up so far: In .htaccess i have a command that removes the www. 301 redirect from www version to the non www (homepage) canonical on index.html pointing to non www version, I also set up a canonical tag for each page on the site search console with non www, www, https www, https non www all set to non www preference. Also, when I fetch the www version in google search console it says it's being 301 redirected to non www version which is basically what I want.Is there anything that i'm missing? These errors on SEM Rush are giving me anxiety lol.
Moz Bar | | donnieath1 -
Link to hotels on http://moz.com/mozcon doesn't work
Hi The link to the hotel for Mozcon 2015 doesn't work - seems like its the 2014 link still in place. Thanks Andy
Moz Bar | | Andy-Halliday0 -
My product pages have no weight / links from root domains with the Moz tool bar
Hi, When I view my home page (http://www.arkwildlife.co.uk) with the Moz toolbar, I see a good PA and a good amount of links from root domains. As I go down the site, it seems to get worse. The category pages (http://www.arkwildlife.co.uk/Category/0/Straight_Foods.html) have a little but not much and then from this point onwards, it's nothing. The product page (http://www.arkwildlife.co.uk/Item/Straight_Foods~Sunflower_Seeds/SUNH/Premium_Sunflower_Hearts.html) is reporting to have no root domain links but I am not sure why. Interestingly, when I click through to a review page (http://www.arkwildlife.co.uk/StockReview/0/SUNH/0/Premium_Sunflower_Hearts.html) it does have some juice. Would anyone be able help on why this is happening and what I need to be looking at in order to resolve it please? EDIT: I've been looking at the hyperlinks and notice something odd. If I review the score with the first link below, it gives a score of 1, but the second gives a PA of 13 with one root domain linked. 1:http://www.arkwildlife.co.uk/Item/Straight_Foods~Sunflower_Seeds/SUNH/Premium_Sunflower_Hearts.html 2:http://www.arkwildlife.co.uk/Item/Straight_Foods%7ESunflower_Seeds/SUNH/Premium_Sunflower_Hearts.html Please note the "%7E" instead of the "~" in the URL. The browser appears to show the ~ character no matter what but the rank of the page changes. I don't understand what the Moz toolbar is doing with this. Note: This behaviour only happens in Mozilla Firefox, in chrome both the rankings are zero for each URL. Many Thanks.
Moz Bar | | nawgie0 -
Find all the back links to all the posts/pages within the blog subdirectory only.
Hi, I am new to Moz. I using the open site explorer to find backlinks for a website's blog. The website itself is huge. I want to find all the backlinks to all the posts/pages within the blog subdirectory only. Not the regular website. I ran a few reports, but it is giving me links to that page, not all the sub pages.Fi
Moz Bar | | DarrenD0