301 redirect domain name and all URL paths remain the same
Hi all,
Firstly, I'm new to this forum, so thank you for having me.
I've started a blog and it's got around 10 articles. There's not many pages and I'm not going to change the URL path.
However, I started with the domain: your-domain.com and yesterday: yourdomain.com was available, so I bought it.
As the site, is 8 weeks odd, in the short term it shouldn't have much impact on the rankings, as everything is on page 10.
My question is:
Is there a quicker way of doing domain level redirect in .htaccess?
Eg.
If: your-domain.com/blog-post can change to : yourdomain.com/blog-post
The old school way is redirect every single page. However, I'm looking for the page to be lightning fast, so if I can reduce the number of 301's that'll be smashing.
Thanks in advance
James
Hi James, welcome to Seo Forum.
What you described is typical use case for 301 redirect. The redirect itself is quick enough. So, as long as you're not chaining multiple redirects, you're fine and single A -> B redirect is what you're looking for.
What do you mean by reducing number of redirects? How many redirects you see in your Network (Browser Console) tab?
Hi there,
I've got to sorted. I've done this:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^olddomain.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www.olddomain.com [NC]
RewriteRule ^(.*)$ https://newdomain.com/$1 [L,R=301,NC]
Thanks anyway
Looks good, good to see you've got it to work.
thanks for sharing good content
If you want to change your domain from "your-domain.com" to "yourdomain.com" permanently, then you should use 301 redirections. Or, you can mark your website "yourdomain.com" as canonical of website "your-domain.com". These are prevalent and accessible techniques. You also can use 302 redirections, if you are not changing permanently.