Monday, December 26, 2011

Part - II: Debugging the Joomla Page Not Found

The Joomla site is moved to online server, the home page is running, but clicking the links & menus shows a 'Page not found' error.

After some search I figured that the problem is not a permission issue, but a configuration issue, because the pages are generated, not physical file. Since the local host was on windows (wamp server), it did have some default setting, and it works. But online, there must be some restrictions, which can only be configured to meet the requirement from server to server. There are two files that control the configuration of Joomla on a linux server - the .htaccess file (mind the dot) and the configuration.php file (both at the root folder of the Joomla installation).

Again after some more search on the configuration issues for Joomla, I found a link, that said:
'I stopped the Search Engine Friendly URLs from the Global Configuration in Administration mode in Joomla and it works'. I fired the Admin module of Joomla and changed that. Yes, it works! Good, but that's a Joomla configuration, so it should work the other way round too. I again reverted the option, and the pages stopped coming again. That's okay, but there's an exclamation mark beside the option below it, 'Use URL rewriting'. On mouseover, it explained that, on Apache server .htaccess must be activated to make that work. I checked my server (by FTP,through FileZilla), it is htaccess.txt, not .htaccess. If this is the case, .htaccess is not activated. I renamed it. Still it is not working I continued searching Google, and found some informative article on .htaccess file. I tried some, learnt some. But it did not help. Still, it's better to know that for URL rewriting to work, you need the following in .htaccess
1) Options +FollowSymLinks
(this may create problem too, on some servers, comment it out then)
2) RewriteEngine On

Then I found the setting required from Joomla's online help, titled Enabling Search Engine Friendly (SEF) URLs on Apache, saying:
2)This step may not be necessary. Open .htaccess in a text editor. Uncomment RewriteBase / (remove the first character, #). If Joomla is installed in its own folder, the enter the Joomla folder name after the backslash. e.g. RewriteBase /yourjoomlafolder. (Those having Joomla on IIS server would also get help from the link Enabling Search Engine Friendly (SEF) URLs on IIS).

Yess! It is now working for both SEF URLs and non-SEF ones (with long string of parameters like ids, etc.). But you should either put both SEF URLs and URL rewriting on or both off from admin panel/Global Configuration.

More on this and other Joomla issues later.

Happy Joomla-ing.

No comments:

Post a Comment