How to enable SEO on Joomla

Wednesday, 19 April 2006

I know, there are many FAQs on Joomla SEO. I still want to point out the essential steps and related information here on teachmejoomla.com:


Joomla has built-in SEO functionality.(SEO stands for Search Engine Optimization). The SEO tab in Global Configuration (in Administration backend)takes care of global SEO settings for your Joomla site.

The tricky part is enabling search engine friendly URLs. If you are wondering what are those good for, here's an example:
A non-sef URL:
www.site.org/index.php?option=com_weblinks&task=view&Itemid=22

The Joomla SEF version of the previous URL:

 

http://www.teachmejoomla.com/component/option,com_weblinks/Itemid,22/ 



3rd party SEF extensions may display "friendlier" URLs, such as

http://www.teachmejoomla.com/useful-links/link-list.html 



These URLs look like static sites for SE crawlers(which is good), and may be easier to memorize and more relevant to your human visitors(especially the ones like the last example). Aditionally, keywords in urls get you a higher search engine positioning in results.

Step 1: check SEF URLs requirements:

There are a few requirements for SEF URLs to work properly(the other SEO configuration options work regardless you have SEF URLs enabled or disabled):
You need to run the Apache Web server.
You need mod_rewrite module on apache. Most hosting companies have that module installed.
Furthermore, you need Apache configuration to allow .htaccess files.

You can easily check your Apache configuration (among other system settings) by going to System->System information and selecting the php info tab in your Joomla administration backend.
There's an "Apache" section and a "loaded modules" subsection there. mod_rewrite should be listed among those modules.

If all went well, you're ready for the next step.

 

Step 2: Configure SEF URLs and rename the htaccess.txt

 

This step requires a FTP client or a web filemanager. (such as cPanel's Filemanager). That will allow you to rename your htaccess.txt and/or revert to non-SEf URL's if something goes wrong.
All you have to do is:
open your Joomla Administration and enter global configuration, select the SEO tab
open your FTP client or the online filemanager for your website, and rename the htaccess.txt file in your Joomla root folder to .htaccess (note that you MUST include the leading dot)

A note to Windows users: Explorer does not allow leading dot filenames.

To rename the file under Win32, you need to click Start->Run, then type cmd (this opens a command line when you hit OK)

then change dir to your local joomla folder (e.g. cd "c:\easyphp\www\joomla" <ENTER>), and issue the following command:

ren htaccess.txt .htaccess
Switch back to your Joomla andministration web browser window, click on "Yes" on the "Search Engine friendly URLs" line, and push the "Save button".
Click on Site->Preview site in new window to check the results and you're done.

If unsuccesful, go to step 3. 

Step 3: I screwed up

Don't worry! It happens all the time.
There is a great chance that you get 500 (Internal server) errors, if something does not work.

Make sure you have the .htaccess file (with the leading dot) in your Joomla root folder. You can also check file's content with your ftp client or filemanager and see if the mambo header comments and the apache directives are there (RewriteRule lines, etc)

If this is ok, your hosting provider could have the .htaccess overrides disabled, so you need to contact them. They may also have the override filename changed in apache config.

Meantime, you need to get your site back online and working until those problems are solved.

Reverting.

Here's how it's done:
open your filemanager or FTP client, and use it to rename your .htaccess back to htaccess.txt
Next, open your configuration.php file (wich is also located in your Joomla root folder) and change the
$mosConfig_sef = '1';
line to:
$mosConfig_sef = '0';

Save the configuration.php and you're back to non-sef, but working URLs.

Resources 

  • Alledia's Joomla SEO book offers an extensive insight on SEO and SEM(Search engine marketing)  for JOOMLA CMS


Give us some social love (it really works now)!

Reddit! Del.icio.us! StumbleUpon! Yahoo! Swik!



Comments (22)
RSS comments
1. skilled soft solutions27-09-2011 11:34

Thanks David Palmer you sorted me out alot especially on the redirects for error handling

2. some tips30-05-2011 10:05

Enabling apache mod_rewrite on Joomla for Search Engine Optimization (SEO) to get Search Engine Friendly URLs (WAMP) 
 
Steps to do that: 
1. Go to the Global Configuration > Site tab at the Backend of your Joomla site and set 
the Search Engine Friendly URLs to "YES". but BEFORE setting the Apache 
mod_rewrite to "YES". do the step 2 - 5 first. 
2. Go to your Joomla root directory "C:\wamp\www\joomla\" 
3. Open the htaccess.txt file and copy the whole content. 
4. Open the notepad and paste all the contents from htaccess.txt. 
5. Save the file as ".htaccess" to do this. click file in menu options, 
hit save as then choose all files and type ".htaccess" then save it.. 
6. Now set the Apache mod_rewrite to "YES" 
 
Restart the apache service and that's it.. you have then enabled the SEF URLs.. 
 
If you encountered the INTERNAL SERVER ERROR see the article below. 
 
WAMP server and .HTACCESS problem 
 
Click on WAMP Icon, then Apache, then httpd.conf file, it will open in notepad. 
or 
Follow this, Go to the "C:\wamp\bin\apache\"Apache_directory"\conf\" and open the 
"httpd.conf" file and do some edit. 
Remove the "#" (uncomment the line below). 
From the line "#LoadModule rewrite_module modules/mod_rewrite.so" 
Save it, then restart the Apache service. 
 
If it works you can also protect you web directories, files, page by using the .htaccess and .htpasswd files.. to do so follow the links below: 
 
Using .htaccess and .htpasswd for password protecting your folders 
http://www.besthostratings.com/articles/password-protection.html 
 
HTaccess encryption online tool 
http://www.4webhelp.net/us/password.php 
 
or watch this video: http://www.youtube.com/watch?v=GH9fBKZKqvk 
 
Thanks! thats all hope it helps to solve your problem.. ;o)

3. Content of .HTAccess30-10-2010 13:11

Good Article but incomplete. Many Joomla sites go wrong after making the changes you suggest, most common being the 404 errors. 
 
It is important to explain the .HTaccess file, what should and should not be hashed out and the security implecations of such changes. 
 

##################################################### 

# READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE 



# The line just below this section: 'Options +FollowSymLinks' may cause problems 

# with some server configurations. It is required for use of mod_rewrite, but may already 

# be set by your server administrator in a way that dissallows changing it in 

# your .htaccess file. If using it causes your server to error out, comment it out (add # to 

# beginning of line), reload your site in your browser and test your sef url's. If they work, 

# it has been set by your server administrator and you do not need it set here. 



##################################################### 

 

## Can be commented out if causes errors, see notes above. 

Options +FollowSymLinks 

 

 



# mod_rewrite in use 

 

RewriteEngine On 

 

########## Begin - Rewrite rules to block out some common exploits 

## If you experience problems on your site block out the operations listed below 

## This attempts to block the most common type of exploit `attempts` to Joomla! 



## Deny access to extension xml files (uncomment out to activate) 



#Order allow,deny 

#Deny from all 

#Satisfy all 



## End of deny access to extension xml files 

 

## Deny access to extension xml files (uncomment out to activate) 

 

Order allow,deny 

Deny from all 

Satisfy all 

 

 

 

 

RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR] 

# Block out any script trying to base64_encode crap to send via URL 

RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR] 

# Block out any script that includes a tag in URL 

RewriteCond %{QUERY_STRING} (\|%3E) [NC,OR] 

# Block out any script trying to set a PHP GLOBALS variable via URL 

RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR] 

# Block out any script trying to modify a _REQUEST variable via URL 

RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) 

# Send all blocked request to homepage with 403 Forbidden error! 

RewriteRule ^(.*)$ index.php [F,L] 



########## End - Rewrite rules to block out some common exploits 

 

# Uncomment following line if your webserver's URL 

# is not directly related to physical file paths. 

# Update Your Joomla! Directory (just / for root) 

 

# RewriteBase / 

 

 

########## Begin - Joomla! core SEF Section 



RewriteCond %{REQUEST_FILENAME} !-f 

RewriteCond %{REQUEST_FILENAME} !-d 

RewriteCond %{REQUEST_URI} !^/index.php 

RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$ [NC] 

RewriteRule (.*) index.php 

RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L] 



########## End - Joomla! core SEF Section 

 

## Additions for error cond 

 

# EE 404 page for missing pages 

ErrorDocument 404 /index.php?/{ee:404} 

 

# Simple 404 for missing files 

ErrorDocument 404 "File Not Found" 

 

 

# Add a trailing slash to paths without an extension 

RewriteCond %{REQUEST_FILENAME} !-f 

RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$ 

RewriteRule ^(.*)$ $1/ [L,R=301]

4. Thanks20-08-2010 03:43

Great article, thanks. Very helpful. :)

5. Very useful text, thank you!07-06-2010 20:24

Following this article I manged to make my Joomla links SEF-y so thanks and keep up the good work. 
 
B.R.

6. It worked! thanks :)18-02-2010 19:24

Thanks a lot. It worked. My client gave me ftp access only and I made the joomla site seo friendly url by renaming the htaccess.txt and editing the configuration file.. 8) 
 
Thank you 
Adnan

7. Cabling Pro07-09-2009 12:25

Pretty useful info on making joomla SE friendly, esp for newbies. Thank you.

8. Personal Page of Rahul Nimawat21-12-2008 01:11

Thank for sharing your knowledge. I was also getting 500 error pages before reading this nice article. I gave a few try and sorted the stuff out. Thanks. 
 
You may want to hire Joomla professional some day: http://www.rahulnimawat.com

9. Solved29-10-2008 14:48
Tudor

Thanks for your feedback. the glitch is solved, at least for FF3 and IE7

10. can't read posts29-10-2008 12:27
keefrichards

Is the owner of this site aware of the text running in to the columns making it difficult to read?

Thanks for sharing this info I love joomla

12. lines cut off20-09-2008 18:25

not sure you know this, but your main center column here is squished in between the two outer columns and as a result the lines get cut off... VERY annoying! You may want to look into that.

Hey great information I have been trying to find out how to get rid of those ugly titles for ages 
 
Rich

14. Keep getting 404 Not Found26-08-2008 01:21

I did everything as follows and can see the new url written when I hover over my links but none of them work. I keep getting 404 erros. Here's an example link for one of the albums in the easygallery component: http://www.example.com/main//component/option,com_easygallery/act,categories/cid,47/Itemid,99999999/

15. Thanks man!01-08-2008 22:25

whoah! 
I thought i wont be able to fix my problem. 
i had trouble reverting my settings. 
my links were gone. 
thanks for the tips here, i manage to fix things back the way they were before. 
 
:grin

16. server error17-07-2008 06:10

i changed htaccess.txt to .htaccess then getting server error?

Many thanks for the article this is great as we have numerous clients who use Joomla and we want to standardise how they are all configured.

18. Thanks07-04-2008 04:36

Nice Article. If you are going to do this, make sure your web server users Apache. Server software such as Zeus does not work with .htaccess re-write, even though they say they have workarounds for it. I persisted with Zeus and re-writes for 2 months, only to give up and change hosting companies. :sigh

19. @518-12-2007 22:36

You're right, but artio joomsef has the capability to 301 non-sef urls to sef urls, for consistency. This option is available in configuration, if you have the latest version.

20. The order of turning on the new URL is i18-12-2007 22:17

If your site pages are indexed in Google with an old non-sef url and then you add the SEF friendly URLs to your site, Google may regard the new URL as duplicate content and it won't put the pages in the primary index or index it atl. :(  
I think the best approach is to tell Google what to index via the Robots.txt file or Site map Google webmaster tools right away. Don't let google just go through the site and pick anything. 
I have found that Google can get confused by the Joomla url structure and index the PDF version and not the main html version. I don't understand that - if anyone else does - please tell me!!! 
Thanks 
Don't forget to visit AFewTips.com

21. system info18-10-2007 19:47

Hi, 
I have no section called Apache, Loaded Modules, 
 
Yes I am on an Apache server using 1.0.12 joomla. 
 
Does my provider have to turn this on ?? 
 
Cheers

Good stuff.But, users should be aware that the default Joomla SEF can cause multiple URLS for ONE content item. This is considered spam in the search engines.To fix this, we created SerrBizSEF. 
 
Additionally, for good SEO, you should html titles and meta data, or at least dynamic versions. 
 
SerrBizSEF does this. Others do as well. So, do visit Joomla Extensions for more Joomla SEF upgrades. :) 
 
Note: Joomla 1.5 has better SEF. We are investigating for additional issues, if any.

Write Comment
  • Please keep the topic of messages relevant to the subject of the article.
  • Please don't use comments to plug your web site. Links are rel='nofollow'-ed
  • Please refresh the page if you're having trouble with the security image code
Name:
E-mail
Homepage
Title:
Comment:

:) :grin ;) 8) :p
:roll :eek :upset :zzz :sigh
:? :cry :( :x
Code:* Code

Last Updated ( Wednesday, 29 October 2008 )
 

Europe freelancer directory

Newsletter

Subscribe to TeachMeJoomla's newsletter
Name:
Email:


Auto tags

joomla seo

joomla seo settings

seo joomla

seo in joomla

seo for joomla

seo settings joomla

joomla and seo

joomla SEO htaccess

joomla mod_rewrite

Use Apache mod_rewrite joomla

mod_rewrite joomla

joomla mod_rewrite 404

how to seo joomla

seo setting joomla

joomla apache mod_rewrite

joomla seo optimization

joomla Use Apache mod_rewrite

joomla seo url

joomla seo friendly urls

joomla seo configuration

joomla enable seo

joomla seo mod rewrite