recently as some of you may notice i’ve redirect my main domain to a new sub domain for the blog, to do so i’ve used .htacess file with the proper SEO redirection to make sure site links and the blog stay as is. Here are the simple rules of the htacess for the redirect:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.blog.lior\.live$
RewriteRule (.*) https://www.blog.lior.live/$1 [R=301,L]
For important rules when doing such a reirection:
- Turn rewrite engine on, otherwise you won’t be able to rewrite condition or rules into htacess file.
- Create the htaccess file with dot!
- restart your apache change once you apply any changes to your htaccess files: sudo service apache2 restart
once you done the redirect, don’t forget the following:
- you want to use wordpress plugin that will automaticlly change all links in your posts and pages into the new url, because at some point users will not come back to your previous domain or the previous domain will expire.
- you want to update external links to the new URL, that including parthnership and in some cases emailing or msging relevant people to update their links.
- test internal links like blog posts links and pages links and see they are redirect properly.
- in complicated situation advice professional and expert SEO and engineers.
- go to search engine console by google and track the transition is doing as expected.
- in some cases you’ll want to notify your users in advance for upcoming chages to your site.
Good luck!
Lior Amsalem embarked on his software engineering journey in the early 2000s, Diving into Pascal with a keen interest in creating, developing, and working on new technologies. Transitioning from his early teenage years as a freelancer, Lior dedicated countless hours to expanding his knowledge within the software engineering domain. He immersed himself in learning new development languages and technologies such as JavaScript, React, backend, frontend, devops, nextjs, nodejs, mongodb, mysql and all together end to end development, while also gaining insights into business development and idea implementation.
Through his blog, Lior aims to share his interests and entrepreneurial journey, driven by a desire for independence and freedom from traditional 9-5 work constraints.
Leave a Reply