Recently I aquired a client who was in need of redirecting their home page, let’s call it
to their sales page at the virtual path of:
They wanted to utilize an .htacess redirect to not only redirect all requests to the root of the site to the sales page, but to also mask the url so that the sales page would be presented as the homepage of the website.
Now, as you may know you can create rules inside of a .htaccess file to control this redirect and mask, however when using CMS systems it can be a little more challenging because there usually are some .htaccess rules already in effect that may contradict with your rules and make things difficult to accomplish.
For Magento users, here’s a quick tip to help you accomplish this goal. Magento is e-commerce software with a built in CMS engine. It allows full control over your store based website including choosing which page is the home page of the site.
- Go to the Settings menu and select Configuration.
- On the left hand side select WEB from the menu
- You will see the optoin to choose which page acts as the homepage of the website. From here you can select using the drop down menu any of your pages.
That’s great for pages, but what if the page you wish to use is not listed in your pages because it is part of your web store? Usually the web store pages are database driven and loaded using the root level index.php file through its coding. So the page you want to act as the homepage is, for example
in the address bar when you visit it on the live site. Notice there is no index.php at the end or any other specific file and extension for that matter.
The solution here is to make use of the Default Web URL field. Currently most likely set to CMS (or cms), you can change this to the direct http path to the portion of your site you wish to be displayed as the home page. Magentowill then re-route all incoming traffic to your root level to this sub level page and the address in the browsers address bar will still read
as opposed to
thereby completing making this virtual path your homepage.
So there you have it. If you are using Magento as your e-commerce, great software by the way, make use of its web configurations settings to control such a task in your site.