Answered by
Oliver Hall
Setting up a 301 redirect on Hostinger can be crucial for maintaining SEO when URLs change or when consolidating multiple pages. A 301 redirect signals to search engines that a page has permanently moved to a new location, helping preserve your rankings and directing traffic appropriately.
Here’s a step-by-step guide to implementing a 301 redirect on a Hostinger-hosted website:
First, you need to access the .htaccess
file in your root directory. This file is used on Apache servers (which Hostinger uses) to rewrite URLs and implement redirects.
.htaccess
file. If it doesn’t exist, you can create a new file named .htaccess
.Open the .htaccess
file and add the following line at the end of the file to create a 301 redirect:
Redirect 301 /old-page.html /new-page.html
Replace /old-page.html
with the relative URL of the original page, and /new-page.html
with the relative URL where you want the traffic to be redirected.
If you're redirecting an entire domain:
Redirect 301 / http://www.newdomain.com/
After adding the necessary redirect rules, save the changes to the .htaccess
file.
To ensure the redirect is working, simply try accessing the old URL via a web browser. You should automatically be taken to the new URL.
.htaccess
file as incorrect configurations can make your site inaccessible.By carefully following these steps, you can effectively manage 301 redirects on your Hostinger-hosted website, thereby ensuring a seamless user experience and maintaining your SEO efforts.