Wanted to redirect your old page to the new page using .htaccess file on permanent basis? Just use given simple code and place it on your server to redirect using 301 and learn its benefits. Whenever you are making changes to your website, whether it is migrating to a new domain, or moving a page to a new URL, it is very important to create redirects so that visitors don’t get lost in the confusion. Missing links and pages not redirected properly form a very unprofessional image of your business. Redirecting in a systematic manner also aids search engines in properly indexing the content of your website.
How to redirect old URL to a new page on Permanent basis?
Normally in a website, the .htaccess file is present in the root directory. We will instruct you step by step how to use a very simple syntax within an .htaccess file to make page, directory or even redirects across the website.
All you need to do is copy the following code given, into your .htaccess file and save the changes. Replace the examples with your actual website/url addresses. If there are multiple pages to be moved, just repeat as necessary.
redirect 301 /oldpage.htm http://www.yourdomain.com/newpage.htm
Example: If your previous page address was under a sub-directory “http://example.com/directory/oldfile.htm”, and your new page is now located at “http://example.com/newfile.htm”, then your .htaccess code will be the following:
redirect 301 /directory/oldfile.htm http://www.example.com/newfile.htm
Benefits of redirecting traffic using a single page 301 redirect
Given below are some of the benefits of redirecting webpages using a 301 redirect:
You don’t lose any website traffic
With the single page 301 redirect in place, users will be easily redirected to the new page instead of coming across the 404 error page and ending up disappointed and moving to other competing web pages.
Google bot friendly
Google has a system in place of removing pages from it’s index when they start returning an error 404 page (Page not found) even if they have a lot of inbound links and constant traffic. So, with a proper 301 redirect in place, the Google bot detects that the page has permanently moved to a new location. This will cause Google to update its index to link the new page, hence redirecting all inbound links and other traffic to that. This maintains the web pages search ranking.