| Howto: 100% Search engine friendly URLs in Joomla! |
![]() Implementing 100% SEF URLs in Joomla! can be a little tricky so we've written a step-by-step guide that includes how to correctly configure your LAMP server. There are some differences in implementing SEF URLs in Joomla! 1.0.* and 1.5, principally the requirement for third-party plugins. We'll deal with the generic LAMP server configuration issues first and then deal with the different versions of Joomla! in turn. AssumptionsIn this howto we've made some assumptions about your web server set-up, your permissions level and your familiarity with the command line. If you only have FTP access then your might have a few difficulties.
Generic LAMP server configurationSSH to your web server. In the website's root (e.g. /var/www/) do:
Edit your .htaccess and it should like this:
Change the RewriteBase variable to the root of your Joomla! install. For example if you've put it in /var/www/joomla this variable should read:
Otherwise leave it as it is. Now in your terminal:
In this file change references to:
to:
Save and exit. Now you need to install the mod_rewrite plugin into Apache. In your terminal run the following command:
Reload your Apache webserver with the following command:
With Joomla! 1.0.*![]() Download and install the component ARTIO JoomSEF from the Joomla! extensions website. There are other SEF extensions available in Joomla! but ARTIO JoomSEF uses an Open Source license and seems to work very well. Make sure that you turn on ARTIO JoomSEF in the Configuration section of the Component. In the Joomla! Admin Panel goto Global Configuration and click the SEO tab. Select Yes to both 'Search Engine Friendly URLs' and 'Dynamic Page Titles'. With Joomla! 1.5Joomla! 1.5.1 was recently released and is now officially stable. If Joomla 1.5 supports all the plugins you want then it's probably worth upgrading to it. If not, then stick with Joomla 1.0.*. One of the great advantages of using Joomla! 1.5 is that it includes SEF URLs out-of-the-box. This makes plugins like ARTIO JoomSEF unnecessary. So, once your LAMP server is correctly configured, goto the Admin Panel select Global Configuration. Select Yes to 'Search Engine Friendly URLs', 'Use Apache mod_rewrite' and 'Add suffix to URLs' (optional) and save. Trackback(0)
Comments (2)
![]() written by Matt Jarvis, 04 March, 2008
If you don't have root access or your hosting company won't turn on mod_rewrite, it's still possible to get SEF URL's with some small mods to the Joomla code. Turn on SEF in the Joomla config as normal, but don't rename the htaccess.txt. Then edit includes/sef.php and comment out the following line :
return $mosConfig_live_site .'/'. $string . $fragment; Replace it with this one : return $mosConfig_live_site .'/index.php/'. $string . $fragment; If that doesn't work, then try : return $mosConfig_live_site .'/index.php?/'. $string . $fragment; In recent Joomla's this code may already be in sef.php, commented out with documentation on how to turn it on. report abuse
vote down
vote up
Votes: +0
Write comment
|
return $mosConfig_live_site .'/'. $string . $fragment;
and add this instead :
return $mosConfig_live_site .'/index.php/'. $string . $fragment;
If this one doesn't work, you can also try :
return $mosConfig_live_site .'/index.php?/'. $string . $fragment;
In recent Joomla's these code snippets may already be in sef.php but commented out, with notes on what to do to enable it.