This is a quick tutorial on how to permanently redirect a page within your website to another page either in a sub-domain or to a new site all together. The reason you might do this is, as in the case of one of my clients, you have set up a new shopping cart on a sub-domain and you need to redirect all of your old product pages to the new pages.
- First you must have FTP access to the files on your server and preferably Sftp as it is more secure.
- Once you are able to see the directories on the server, you must make hidden files visible. Any time a directory name starts with a dot, like .htaccess, it is a hidden file. After you make hidden files visible you should see several new files and if you are in the top directory of your website file system, you should see the .htaccess file.
- Copy this file to your computer, and make a backup version that you will not be working on in case you need to revert to the original.
- Now, open you working version in a text editor. Be sure that you are using an actual text editor and not a word processor. Some examples of text editors are: For Windows, Notepad++; for Mac, Text Wrangler; and for Linux, Kate.
- There are a couple different types of code that can be used for a redirects. I will only discuss one method here and leave that discussion for another time. Here is what it looks like:Redirect 301/product/the-old-product-page/
- Enter your line of code at the bottom of the .htaccess file with the appropriate file path of the old page first and the URL of the page you are redirecting to second.
- Repeat this process for every product page and category that you need to redirect.
I hope you have found this tutorial helpful. Please add your comments below if you have questions or can add to this topic.