Website Services

Hide the Subdirectory to Joomla

Joomla often needs to be installed into a subdirectory off your site root, but you may want to hide this in the urls so that it appears to be installed in the root of your website. I.e. users access your joomla site at instead of

I used the notes at DRich Productions to configure .htaccess to do the appropriate redirections.

These notes assume Joomla 1.5

Let's assume Joomla is installed under the 'joomla' subdirectory.

Copy the .htaccess file in joomla directory to the site root directory. Backup the old root .htaccess file first as you may need to include some or all of its contents in the new one, depending on what is currently in there .

Replace the line

#  RewriteBase /


RewriteBase /
# Add trailing slash if path does not contain a period or end with a slash
RewriteCond %{REQUEST_URI} !(\.|/$)
RewriteRule (.*)$1/ [R=301,L]
# Change to (Optional)
RewriteCond %{HTTP_HOST} ^$
RewriteRule ^/?(.*)$$1 [R=301,L]
# Exclude any subdirectories in the site root that should NOT be re-directed to joomla
# At least include the joomla directory here. The other commented lines are examples and will need customising
# It is probably best not to use directories in your site root that also exist in joomla e.g. images
RewriteCond %{REQUEST_URI} !^/joomla
#RewriteCond %{REQUEST_URI} !^/some-special-directory
#RewriteCond %{REQUEST_URI} !^/(dokuwiki|phpmyadmin|stats)
#Rewrites to
RewriteRule ^(.*)$ joomla/$1 [L]

Obviously, change joomla to the directory where joomla is installed on your site if different.

Edit configuration.php in joomla directory and change

var $live_site = '';


var $live_site = '';

We use cookies. By browsing our site you agree to our use of cookies.

I understand (removes this notice). Find out more