In the previous post, we discussed the overview of the importance of creating a customized 404 html page so as to provide visitors a way to navigate back to your site through the links provided in the notfound page.
There are instances where we need to rename some URLs of our indexed web pages, other times, move them to different locations or directories, or even transfer them to totally different domain. And consequently, visitors may encounter not found page. To avoid losing visitors and search engine rankings, you can point the old indexed urls to the newly updated urls by using redirection.
The redirection process can be done by inputing some line of directives in .htaccess. To open the .htaccess, see the instruction in the previous post. Here's what to put in the .htaccess file: redirect 301 /old/old.html http://www.yourdomain.com/new.html. The old.html page under old folder is really the old filename, without the "http://www" and next to it, sepatated with a space, is the complete url of new file. As simple as that!
After that final touch on .htaccess, you can then upload it and check whether you did it successfully. Enter the old url in the address bar and see if it is redirected to the new page you pointed to. If a page not found is displayed, you probably made some wrong inputs in the .htaccess. Just make sure that urls inputted are valid and the format of the directive line is correctly followed.
No comments:
Post a Comment