301 Redirects
-
Hi,
I have switched my site from a http .co.uk site to a https .com site. I have set a 301 redirect in the .htaccess file pointing all traffic going to the original .co.uk site to go to the new https:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^up-bus.co.uk$ [OR]
RewriteCond %{HTTP_HOST} ^www.up-bus.co.uk$
RewriteRule ^(.*)$ "https://www.up-bus.com/$1" [R=301,L]however when i search in google for keywords the original .co.uk site is still registering in search, is there something else I am required to do to tell google to use the new https site instead? Do i need to do redirects for every page, or is what I have done above sufficient?
Hope you can help, I am struggling with getting our site to register on google search, any advice greatly welcome
Thanks in advance,
Ian
-
Thanks Robert. All done
-
Ian, Make sure you added your HTTPS version into WMT (search console) and also choose www as preferred domain. Rewrite is fine.
-
Hi Robert,
thank you for your response made the change around a month ago. Be great if your apache expert had a perfect re-write rile for this, let me know if you hear of anything
Thanks again,
Ian
-
I would speak to your hosting provider it is not a big deal but here are the layouts of what you need to do essentially.
I hope these answers are helpful some of them are mine some of them are other people that definitely know what they're doing. Robert and Ryan are smart guys as well and listen to what they say.
https://moz.com/community/q/site-migration-and-traffic-help
https://www.deepcrawl.com/knowledge/best-practice/the-zen-guide-to-https-configuration/
https://yoast.com/dev-blog/move-website-https-ssl/
https://www.youtube.com/watch?v=ekvnE4YMeyM#t=23m08s
#Force www:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301,NC]
#Force non-www:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.example.com [NC]
RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
More
https://www.deepcrawl.com/knowledge/tag/https/
I hope this helps,
Tom
-
Ian,
First with the change to .com read what Ryan wrote and follow the change of address steps.
How long ago did you make the change?
Take a look at these common problems on HTTPS switch by Cyrus Shepard a year or so ago and see if you have more work to do. (Mistakes are roughly a third of the way down.)
I will follow the question and am checking our Apache expert re the perfect rewrite rule for this. If he is not on a 100 mile bike ride I should hear from him shortly. Otherwise, maybe tomorrow. I will PM you worst case.
Best
-
Hi Ian. You can go to Google Search Console, register your ownership of both domains, then go into the gear settings for .co.uk and select "Change of Address" and supply the .com domain. That's one step in the process that can help speed up the change.
Another is changing from the old address to the new in as many locations as practical where you were linked from the old one. As Google constantly crawls the web it will also notice these changes and add them to the list that says your .co.uk site is now on the .com. Places include social profiles, business listings, reviews--pretty much any place online where your site interacts.
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
-
Is 301 redirect replacing or adding PA on a page ?
Hello Moz community, I am re-structuring information architecture on a website. The homepage targets keyword A
Technical SEO | | Sindicic_Alexis
There is a page /page-on-B/ that targets keyword B
There is also an older page /page-on-kinda-B/ that targets a keyword which is really close to B ( i think they should have been worked on the same page...) I want to re-optimise the homepage on keyword B because i know it is worth the effort. If i re-write the homepage to talk about B and do a 301 redirect of : /page-on-B/
/page-on-kinda-B/ to the homepage is it going to add page authority to the homepage ? is it the right way to proceed ?
Thanks for your support !0 -
301 redirect from sites closing down
Hi We have around 10 supplementary sites that have links to our site which are now closing down but are out of our control. We could have access to their domains so how could we maintain the link juice from these old sites which are going to our new site? However there will be no websites left on these old supplementary just domain names
Technical SEO | | ocelot0 -
Help writing a .htacess file with the correct 301 redirects
Hello I need help writing a .htaccess file that will do two things. URL match abc.com and www.abc.com to www.newabc.com except one subdomain was also changed www.abc.com/blog is now www.newabc.com/newblog everything after blog matches. Any help would greatly be appreciated. Thanks
Technical SEO | | chriistaylor0 -
301 redirects
Hello. Our site was recently rebuilt, and we switched from using index.php in all the urls to not using it at all. We also changed the names of many of our pages. So the urls have been renamed from "example.com/index.php/old_page_name/" to "example.com/new-page-name/". While we were at it, we changed from "_" to "-" as our word separators in the urls. In the .htaccess file, we have a small block of code that strips out "index.php/" from all requests. This code redirects a request for "example.com/index.php/old_page_name/" to "example.com/old_page_name/" For your information, the code that strips out "index.php/" is: RewriteCond %{THE_REQUEST} ^GET.index.php [NC]
Technical SEO | | nyc-seo
RewriteCond %{THE_REQUEST} !/uSZWTLna/.
RewriteRule (.?)index.php/(.*) /$1$2 [R=301,L] Then we have 301 redirects from "example.com/old_page_name/" to "example.com/new-page-name/" QUESTION 1: Is this two-step redirect approach okay, or would it be better to skip the separate index.php stripping code and simply have 301 redirects that include "index.php" in the urls? QUESTION 2: Will we lose some of the benefit of the links that have to pass through a 301 redirect? QUESTION 3: We have 50 or so redirects. Will this affect performance of the site? How many redirects does it take to start affecting performance? Thank you!0 -
How can I perform this 301 redirect?
I am working on a site for a colleague and have installed wordpress on their server in the wp directory, they want the root domain redirecting to the wp directory but everything i have tried seems to throw up errors. i need sample.co.uk to redirect to sample.co.uk/wp/ no matter which html file they are trying to access on the root of the sample.co.uk site help?
Technical SEO | | GrassRootsSEO0 -
301 Redirect question www to root.com
I have a site that has been up for a few weeks now and is currently in a www format and i am considering changing it to just mydomain.com I also have quite a few directory listings (including google places/bing) for this site w/ the www. url. If i do this, change it in my google analytics, and update my wordpress internal page + htaccess file. Will i lose any of the link juice i had from my www pages? Would this be something that would be advised since i've registered for many sites, or is there a potential that this could end up hurting me? Thanks,
Technical SEO | | tgr0ss0 -
Does it really matter to set 301 redirect for not found error pages?
I've very simple question for not found error pages. Does it really require to set up 301 redirect for all not found error pages which detected in Google webmaster tools? Honestly, I don't want to set 301 redirect exclude externally connected pages. So, what will impact on ranking after follow this process?
Technical SEO | | CommercePundit0 -
Using DNS & 301 redirects to gain control over a rogue site
I'd appreciate peoples' views on the following please. We have been approached by a client whose website does not rank # 1 for their own distinctive brand name due to this position being taken by a site they had developed for them by an affiliate some years back. The affiliate's site is clearly seen by Google as the definitive site for the brand - being older, having more links & in both Yahoo & DMOZ. The relationship has soured with the affiliate & the client wants to take control of the affiliate site & have it 301 redirect to the 'real' brand site. The affiliate won't cooperate (funny that). However whilst the client doesn't have control over the affiliate's website, they do own the domain. Given this, it seems that an option is to temporarily create a 1 page website on another server, change the affiliate website domain DNS settings to point to this, & in turn have that 301 re-direct to the client's website. This is a bit of a round about approach, but necessary because the affiliate won't directly 301 the site they control - despite the client owning it. (As I say the relationship has soured). If you think there's a better alternative approach to this problem (aside from litigation), I'd appreciate hearing it please. Thanks.
Technical SEO | | SureFire0