| Custom error page, default error page vs htaccess |
| Sunday, 28 September 2008 14:59 | |||
|
Custom error page, default error page vs htaccess Question: We bought a competitors site who went out of business. We want to leverage their back link popularity, bookmarks to increase our own ranking. However, our site is built using Joomla and utilizes sh404 custom error pages. We parked the domain on our parent site and set the .htaccess to 301 redirect all requests of the parked domain to our parent domain. This works perfectly for requests to the home page (competitor.com resolves to parent.com), but the internal URLS of the old site, returns a 404 because competitor.com/url.html is redirected to parent.com/url.html. The file url.html does NOT exist so returns a 404 page. If this was just one url, we could set a custom redirect via sh404, or via .htaccess, but were talking about 1000's of urls. It would be extremely time consuming to manual set custom redirects. What we would like is to have all error pages set to 301 redirect to the home page. What to do? *For pages of particularly high PR value, we will manually set custom redirect. Answer: Given the above objective, we would set sh404 to use the default joomla error page and add this php redirect to the default joomla error page which is located at: /templates/system/error.php Right after... defined( '_JEXEC' ) or die( 'Restricted access' ); ... add this code: <?php So, now, when the default Joomla 404 page is requested, it 301 redirects to the home page. Of course, you could have set it to ANY page you wanted. We agree with setting to the home page as that is typically the most important page of any site, as least in the eyes of the search engines. Given that you have thousands of urls to deal with, this should increase your home pages PR and back links quickly. Of course this modification will conflict with Google Webmaster tools file verification function. The work around is to use the Google Verification META tag instead. The only issue we see with using the Verification meta tag is it lets competitors see you are using Google webmaster tools. Though, it is not that important as it is pretty much assumed that if you ranking well in Google, you are using Google webmaster tools in some capacity.
|