Joomla: howto setup SEO/SEF

Joomla: howto setup SEO/SEF

Joomla: howto setup SEO/SEF 150 150 Roderick Derks

Using the Artio JoomSEF module I changed my URL's so that the human species can understand them. And also Google likes these much more.

It took a while to get things working, but I finally did it. And so I deserved my beer for today.

Let's hit it. Make sure that:

  1. the .htaccess exists in the root of your Joomla! site
  2. the 3rd party section rules in .htaccess are uncommented (see below)
  3. the "RewriteBase" rule matches YOUR Joomla! installation
  4. Joomla! SEF is "ON" in site "Global configuration" (see below)
  5. JoomSEF is "ON" in site "JoomSEF configuration"
  6. Apache hands out enough rights to use the .htaccess file

Edit the .htaccess file
# vi /var/www/r71/.htaccess

Options FollowSymLinks
RewriteEngine On
 RewriteBase /

########## Begin – 3rd Party SEF Section
RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR]             ##optional – see notes##
RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$  [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php
########## End – 3rd Party SEF Section

# Block out any script trying to set a mosConfig value through the URL
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 <script> tag in URL
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%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

Adjust Joomla config file (file found in the root of the website)
#vi configuration.php
$mosConfig_sef = '1';

————-

Edit the Apache config file (if you don't have acces to it: get you own server 😉 )
#  vi /etc/httpd/conf/httpd.conf

<Directory />
    Options FollowSymLinks
    AllowOverride All
</Directory>

# This should be changed to whatever you set DocumentRoot to.
<Directory "/var/www/html">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

 

Roderick Derks

Liefhebber van fietsen, van het oplossen van IT puzzels, en van het delen van informatie om anderen te helpen.

All stories by:Roderick Derks

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Your Name (required)

Your Email (required)

Subject

Your Message

Your Name (required)

Your Email (required)

Subject

Your Message