Friday, 08 May 2009 15:15
The SEO refers to search engine optimization. The SEO is the process of improving the volume and quality of traffic to a website from search engines. The SEO can also be referred to as SEF, or Search Engine Friendly.
The websites are considered search engine friendly when they can be easily found from them. By default Joomla uses dynamic URL. These URL are usually long and contain many parameters.
1. Advantages of SEF URL
The most significant advantages of SEF URL are these:
- They are short in length.
- They are readable and easily remembered by humans.
- They contain keywords.
- They don't "break" in blogs and emails.
- They are more accurately indexed by the search engines.
2. Before the Activation of SEO Functions
For Websites built with Joomla there is a built-in feature of Joomla which uses the extension mod_rewrite of Apache Server in order to re-write the URL. The Tip has been tested on version 1.5 of Joomla, the operating systems Windows and Linux, on which Apache Server was installed. The IIS Server of Microsoft is working differently in terms of URL re-writing, and it does not apply for this Tip.
Before you activate the Joomla SEO functions, you should check the following:
- Your web hosting provider allows you to use ".htaccess" files.
- Ask your web host if the extension mod_rewrite of Apache is already activated by them or should be enabled separately by you (inside the .htaccess file).
- Make sure that the "htaccess.txt" file, which is already included in the initial installation of Joomla, is in the "root directory", where you installed Joomla. If for some unknown reason you don't have the Joomla's default htaccess.txt file, you can download it from here: Joomla htaccess.txt file.
3. Configuration of File ".htaccess"
Open the above htaccess.txt file in Joomla with an editor, eg. Notepad for Windows.
- Now if your hosting provider said, that the mod_rewrite of Apache is already activated by them, then you should "comment-out" line 28 of the file (otherwise leave as it is):
28. RewriteEngine On
by typing the character #
before the command RewriteEngine On
:
28. # RewriteEngine On
- Another line that deserves attention is the line 53 of the file:
53. # RewriteBase /
If you have installed Joomla in the root directory of your web-space (for instance public_html or htdocs), then you have to delete the character #
before the command RewriteBase /
:
53. RewriteBase /
Otherwise if you have installed Joomla in a subfolder under the root directory of your web-space, eg. http://www.mysite.com/joomla/, you should change line 53 to:
53. RewriteBase /joomla
4. Save and Rename of File "htaccess.txt"
When you are ready with the above changes, save the file. Now you have to rename the file "htaccess.txt" to ".htaccess" in order to proceed. One easy way is to use an FTP program. Personally I use FileZilla, which is a freeware and enriched with many functions FTP program.
- If you have FileZilla installed, find inside your local directory tree view the htaccess.txt file. Right click with the mouse on it and select "Rename".

- Enter the name ".htaccess" for the file. Then right click with the mouse again and select "Upload" to upload the file in root directory of your Joomla installation.

5. Joomla SEO Settings
- Go to the Control Panel of your Joomla administration backend and click on "Global Configuration".
- On the first tab called "Site" and on the right side you can see the three "SEO Settings".

Before you enable any of these settings, take a look how a Joomla dynamic URL appears on the browser address bar.
- The first setting is: "Search Engine Friendly URLs". Click on "Yes" and then on the upper right side on "Apply". After this setting the above URL appears in the browser as:

- The second setting is: "Use Apache mod_rewrite". Click on "Yes" and then on the upper right side on "Apply". After this setting the above URL appears in the browser as:

- The third and last setting is: "Add suffix to URLs". Click on "Yes" and then on the upper right side on "Apply". After this setting the above URL appears in the browser as:

6. Troubleshooting
In case you get error messages from Apache, after you enable the SEO settings (like 404 file not found or 500 internal server error), then you have to:
- Visit the website with Joomla's technical requirements to make sure that you meet at least the minimum of these.
- Double-check that you renamed the file "htaccess.txt" to ".htaccess" and that you uploaded it to Joomla's root directory.
- Ask your web hosting provider if he does have Apache's extension mod_rewrite installed on the server and ofcourse that they allow you to use .htaccess files.
- Modify the .htaccess file, as I have indicated above, in case you have installed Joomla in a subfolder of your web-space, or if your web host told you to change something specific.
7. Last Resort
If none of the above help or the hosting provider doesn't allow the use of mod_rewrite in Apache, you can:
- Enable only the first and the third SEO setting (Chapter 5). Click on "No" for the setting "Use Apache mod_rewrite" and on the upper right on "Apply". Then rename the ".htaccess" file back to "htaccess.txt", since you don't need it anymore. In this way you're going to have at least friendlier URLs than before.
- Post your issue on the Joomla Forum with all details about the server environment on which Joomla is installed (PHP, MySQL and Apache versions etc.).