HLVC Design - Behancé HLVC Design - Facebook HLVC Design - Twitter HLVC Design - Instagram Helvecio da Silva - LinkedIn

To keep things organized, I install Joomla inside a folder at the root level.

In this tutorial, by using redirecting, I will show you how to make this folder invisible in your site URL.

How I do it

Joomla has been installed in a folder called cms and this is how URLs are displayed when you navigate to the About page:


However, you want your visitors to see the following in the address bar:


The first step to create this redirecting is to create a .htaccess file at the root level of your site. You can use an FTP client or your server's file manager.

WARNING: in case you find a .htaccess file in your home folder, download it, back it up and check if there is any content in it. If you don't understand what you ser or must to, I strongly suggest you to stop now and avoid bringing down your website(s).

Follow the instructions on the lines marked by a #.

# Do not modify the line below 
RewriteEngine on
# Change 'example.com' to your domain
RewriteCond %{HTTP_HOST} ^(www.)?example.com$
# Change 'subfolder' to the name of the folder you installed Joomla
RewriteCond %{REQUEST_URI} !^/subfolder/
# Do not modify the lines below
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Change 'subfolder' to the name of the folder you installed Joomla
RewriteRule ^(.*)$ /subfolder/$1
# Change 'example.com' to your domain again
# Change 'subfolder' to the name of the folder you installed Joomla one more time
# followed by / and the main file of Joomla: index.php
RewriteCond %{HTTP_HOST} ^(www.)?example.com$
RewriteRule ^(/)?$ subfolder/index.php [L]

Upload this file to the root level of  your domain.

Now open configuration.php and find the following lines:

var $live_site = '';
var $log_path = '/home/username/public_html/subfolder/logs';
var $tmp_path = '/home/username/public_html/subfolder/tmp';
var $ftp_root = 'public_html/subfolder';

Change as follows:

  • In var $live_site insert your site URL.
  • In var $log_path, var $tmp_path and var $ftp_root remove the references to your subfolder.
var $live_site = 'http://www.exemplo.com'; 
var $log_path = '/home/username/public_html/logs';
var $tmp_path = '/home/username/public_html/tmp';
var $ftp_root = 'public_html';

If var $ftp_root is empty, you don't have to include public_html.

Now do your test run. If your website goes offline or spews out some errors, just undo what you just did.

Remember to backup your .htaccess and configuration.php before changing them!

Pin It

About This Blog

The goal of HLVC blog is to share, in plain words, tips on developing websites using the Joomla CMS. In addition, ideas and suggestions on marketing will be presented to strengthen the relationship between brands and their audiences in the digital era.

Blog Search