Actions

Difference between revisions of "Enabling Search Engine Friendly (SEF) URLs on Apache"

From Joomla! Documentation

(Apache Instructions)
Line 2: Line 2:
  
 
SEF URL implementation is possible under Microsoft's IIS webserver as well, please see [[IIS and Joomla]].
 
SEF URL implementation is possible under Microsoft's IIS webserver as well, please see [[IIS and Joomla]].
 +
 +
In Joomla! 1.6 basic SEF urls are enabled by default. In prior versions you need to use the Global Configuration to enable them.
  
 
==Apache Instructions==
 
==Apache Instructions==
Line 8: Line 10:
 
:2. Make sure that Mod_rewrite is working. Check that the line shown below in the file "apache/conf/httpd.conf" is uncommented. If necessary, uncomment the line and re-start the Apache web server.
 
:2. Make sure that Mod_rewrite is working. Check that the line shown below in the file "apache/conf/httpd.conf" is uncommented. If necessary, uncomment the line and re-start the Apache web server.
 
::<code>LoadModule rewrite_module modules/mod_rewrite.so</code>
 
::<code>LoadModule rewrite_module modules/mod_rewrite.so</code>
:3. In Global configuration, select yes to all three SEF options. The action of the three parameters is as follows:
+
:3. In Global configuration, set the three SEF options. The action of the three parameters is as follows:
 
::* '''Search Engine Friendly URLs.''' Converts the URLs from the native Joomla! format to the SEF format.
 
::* '''Search Engine Friendly URLs.''' Converts the URLs from the native Joomla! format to the SEF format.
 
::* '''Use Apache mod_rewrite. ''' Uses the Apache "mod_rewrite" function to eliminate the "index.php" portion of the URL. If you don't want to use mod_rewrite, set this to "No" and don't rename the htaccess.txt. The SEF URLs feature will still work. The only difference is that you will see "index.php" in the URL, for example, <code><nowiki>http://www.yoursite.org/index.php/faq.html</nowiki></code>.  
 
::* '''Use Apache mod_rewrite. ''' Uses the Apache "mod_rewrite" function to eliminate the "index.php" portion of the URL. If you don't want to use mod_rewrite, set this to "No" and don't rename the htaccess.txt. The SEF URLs feature will still work. The only difference is that you will see "index.php" in the URL, for example, <code><nowiki>http://www.yoursite.org/index.php/faq.html</nowiki></code>.  
 
::* '''Add suffix to URLs.''' Adds ".html" to the end of URLs.
 
::* '''Add suffix to URLs.''' Adds ".html" to the end of URLs.
 +
  
 
[[Category:FAQ]]
 
[[Category:FAQ]]
Line 17: Line 20:
 
[[Category:Getting Started FAQ]]
 
[[Category:Getting Started FAQ]]
 
[[Category:Version 1.5 FAQ]]
 
[[Category:Version 1.5 FAQ]]
 +
[[Category:Version 1.6 FAQ]]
 
[[Category:Category Management]]
 
[[Category:Category Management]]

Revision as of 07:52, 8 January 2011

This article addresses SEF URLs under the popular, open-source Apache webserver.

SEF URL implementation is possible under Microsoft's IIS webserver as well, please see IIS and Joomla.

In Joomla! 1.6 basic SEF urls are enabled by default. In prior versions you need to use the Global Configuration to enable them.

Apache Instructions

1. Rename htaccess.txt to .htaccess.
  • If Joomla is installed in its own folder, uncomment "RewriteBase /" and enter the Joomla folder name after the backslash. Example: RewriteBase /joomla
2. Make sure that Mod_rewrite is working. Check that the line shown below in the file "apache/conf/httpd.conf" is uncommented. If necessary, uncomment the line and re-start the Apache web server.
LoadModule rewrite_module modules/mod_rewrite.so
3. In Global configuration, set the three SEF options. The action of the three parameters is as follows:
  • Search Engine Friendly URLs. Converts the URLs from the native Joomla! format to the SEF format.
  • Use Apache mod_rewrite. Uses the Apache "mod_rewrite" function to eliminate the "index.php" portion of the URL. If you don't want to use mod_rewrite, set this to "No" and don't rename the htaccess.txt. The SEF URLs feature will still work. The only difference is that you will see "index.php" in the URL, for example, http://www.yoursite.org/index.php/faq.html.
  • Add suffix to URLs. Adds ".html" to the end of URLs.