1

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]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
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?

Sjon
  • 4,989
  • 6
  • 28
  • 46

2 Answers2

0

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]
Amit Verma
  • 40,709
  • 21
  • 93
  • 115
0

in configuration.php you need to set

$live_site = "http://www.example.com"; 

(SO dont allow mydomain.com)

Check this answer for more info:

Community
  • 1
  • 1
jonasfh
  • 4,151
  • 2
  • 21
  • 37