.htaccess - hides the Joomla 3 installation directory from the URL


I just created a Joomla 3 site (offline at the moment). Joomla was installed at www.mydomain.com/jo/ directory, and at .htaccess file I included the following rule to redirect from www.mydomain.com to www.mydomain.com/jo/, and it's working fine:

RewriteCond %{HTTP_HOST} ^(www.)?mydomain.com$
RewriteRule ^(/)?$ jo [L]

I'm using URL Rewriting also working great after making adjustment at .htaccess

I searched for two days how to get rid of /Jo directory in URL. I found a code which work partially:

Options +FollowSymLinks
RewriteRule !^jo(/.*)?$ /jo%{REQUEST_URI} [QSA,L]
RewriteRule ^jo(/(.*))?$ /$2 [R=301,L]

The problem is it hide the directory on website landing page / homepage, as menu item or article is selected it show directory in URL.

How to achieve this?

You can use the following code to remove /jo/ dir completly from your urls :

RewriteEngine on

RewriteCond %{THE_REQUEST} /jo/([^\s]+) [NC]
RewriteRule ^ /%1 [NC,L,R]
RewriteRule ^((?!jo).*)$ /jo/$1 [NC,L]