HTTPS 301 Redirect Question
-
Hi,
I've just migrated our previous site (siteA) to our new url (siteB) and I've setup 301 redirects from the old url (siteA) to the new (siteB). However, the old url operated on https and users who try to go to the old url with https (https://siteA.com) receive a message that the server cannot be reached, while the users who go to http://siteA.com are redirected to siteB.
Is there a way to 301 redirect https traffic?
Also, from an SEO perspective if the site and all the references on Google search are https://siteA.com does a 301 redirect of http pass the domain authority, etc. or is https required?
Thanks.
-
Hi Jonathon,
Below is what I have in my htaccess file:
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] -
I don't know if you admin your own server, but if you do, you should be able to easily tell it to redirect HTTP to HTTPS. I do this with Apache (it's much easier and faster than .htaccess) and it works really well.
-
Hi Jonathon,
If the one I posted above doesn't work, try this one:
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^(.*) https://www.newsite.com%{REQUEST_URI} [R=301,NC]Both should do exactly what you want, but let me know how you go!
Cheers,
David
-
Hi David,
Thanks.
the htaccess for the site currently looks like this:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.oldsite.com$ [NC]
RewriteRule ^ https://www.newsite.com%{REQUEST_URI} [R=301,L]
The end goal would be to redirect:
To the new url:
Thanks for your help.
-
Hi Jonathon,
I did this recently and used the following in my htaccess file:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^oldsite.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.oldsite.com$
RewriteRule (.*)$ https://www.newsite.com/$1 [R=301,L]It redirects http and https to the new domain.
Is this what yours looks like? Can you copy and paste what you are using in your htaccess file so we can check it out? (use oldsite/newsite - don't need to give us the domain)
Cheers,
David
-
Hi,
Sorry I may not have explained the issue well enough.
I'm still looking to use https.
I simply want to redirect https://oldsite.com (and http://oldsite.com) to https://newsite.com, but I can seemingly only redirect http traffic with a 301 redirect in the htaccess file.
Thanks.
-
Google recommends using https (https://webmasters.googleblog.com/2014/08/https-as-ranking-signal.html). Is there a reason why you no longer wish to utilize it?
Otherwise, this might work for your redirect: http://stackoverflow.com/questions/8371/how-do-you-redirect-https-to-http
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
-
Do bulk 301 redirects hurt seo value?
We are working with a content based startup that needs to 301 redirect a lot of its pages to other websites. Will give you an example to help you understand. If we assume this is the startups domain and URL structure www.ourcompany.com/brand1/article What they want to do is do a 301 redirect of www.ourcompany.com/brand1/ to www.brand1.com I have never seen 301 as a problem to SEO or link juice. But in this case where all the major URLs are getting redirected to other sites i was wondering if it would have a negative effect. Right now they have just 20-30 brands but they are planning to hit a couple of hundreds this year.
Intermediate & Advanced SEO | | aaronfernandez0 -
Should I do a redirect
Hello, I am building a new website with a new web address for subpages. The domain name stays the same. I am wondering if I should do redirect to the few pages that have an outside link going to them. I noticed all my subpage that don't have any external link have an authority of 18. I only have 1 subpage that has 2 external links and 1 of them has a spam score of 32 and then other one of 1. My website is about a 100 pages. What should I do for my subpages redirect , not redirect, redirect only the ones that have external links ? Thank you,
Intermediate & Advanced SEO | | seoanalytics0 -
Huge httaccess with old 301 redirects. Is it safe to delete all redirects with no traffic in last 2 months?
We have a huge httaccess file over several MB which seems to be the cause for slow server response time. There are lots of 301 redirects related to site migration from 9 months ago where all old URLs were redirected to new URL and also lots of 301 redirects from URL changes accumulated over the last 15 years. Is it safe to delete all 301 redirects which did not receive any traffic in last 2 months ? Or would you apply another criteria for identifying those 301 that can be safely deleted? Any way to get in google analytics or webmaster tools all 301 that received traffic in the last 2 months or any other easy way to identify those, apart from checking the apache log files ?
Intermediate & Advanced SEO | | lcourse0 -
Redirecting a redirect - thoughts?
Hi! A client has just had 14k 404s pop up in his WMT. I think this is because a page that they redirected to had moved. My question is, can I clean these up by redirecting the page the original redirect was one? If so, will it have any negative impact?
Intermediate & Advanced SEO | | neooptic0 -
301 Redirect pages with .aspx extension
I want 301 redirect all a website's subpages with a .aspx extension to a page without the .aspx etension. Example: I want to 301 redirect www.website.com/services.aspx to www.website.com/services Right now if you do not include .aspx on the end of every URL it gives a 404 error. I have used the web.config file to 301 redirect non-www to www and /default.aspx to /. I am not extremely familiar with IIS 7.0 or web.config, so any help would be great. Thanks.
Intermediate & Advanced SEO | | VentaMarketing0 -
After the 301 redirect
Hi all, A quick question, after you have setup your 301 re-directs in .htaccess - is it necessary to keep your content in the original domains directory? My thinking is that requests do get as far as referencing the directory, thus it should be safe to delete all the files on the old domain? Thanx!
Intermediate & Advanced SEO | | gazza7770 -
What happens with a 301 redirected page?
Hi All, What happens with an indexed page that I 301 redirect?
Intermediate & Advanced SEO | | BeytzNet
Is it removed from the Google index after a while? Thanks0 -
How To 301 Redirect .html pages
I need to redirect a page/URL that is purely .html to a new location. I don't know how to do this. All the redirects I can find are for server side code pages .php/.aspx etc. From my understanding I can't put a server side redirect in a .html file. I am hosting on a microsoft server, however the new page I am redirecting to is .php. I am running some WordPress (.php) files on the server. I need to make it redirect before the old page loads so visitors don't start reading something that is about to get redirected Can someone please help me?
Intermediate & Advanced SEO | | MyNet0