Back to Applications

Can I Rewrite Joomla To A Sub-Directory


Yes, though this is beyond what WestHost Tech Support can do for free. Here is a guide from http://www.drichproductions.com/ on the matter.

Rewrite Root Directory to Subdirectory for Joomla, but likely can be adapted as needed for other site apps.

I came across the problem of how to rewrite (not redirect) users to a subdirectory while trying to install Joomla 1.5 in a subdirectory. The problem came when I wanted to hide the subdirectory. Instead of www.yoursite.com/subdir, I wanted the users to just see www.yoursite.com. To do this, you must update the .htaccess files in the root directory with the following code:

Options +FollowSymLinks
RewriteEngine On
RewriteBase /

# This section must come first!
# Add a trailing slash if the path does not contain a period or end with a slash
RewriteCond %{REQUEST_URI} !(\.|/$)
RewriteRule (.*) http://www.yoursite.com/$1/ [R=301,L]

#Change http://yoursite.com to http://www.yoursite.com (Optional)
RewriteCond %{HTTP_HOST} ^yoursite.com$
RewriteRule ^/?(.*)$ http://www.yoursite.com/$1 [R=301,L]

#Rewrites http://www.yoursite.com/subdir to http://www.yoursite.com/
RewriteCond %{REQUEST_URI} !^/subdir
RewriteRule ^(.*)$ subdir/$1 [L]

Replace your with the name of your website
Replace subdir with the name of your subdirectory

For Joomla 1.5 users, place the .htaccess in the root directory of your website and change the following:

Change
# RewriteBase /
To
RewriteBase /
# Add a trailing slash if the path does not contain a period or end with a slash
RewriteCond %{REQUEST_URI} !(\.|/$)
RewriteRule (.*) http://www.yoursite.com/$1/ [R=301,L]
#Change http://yoursite.com to http://www.yoursite.com (Optional)
RewriteCond %{HTTP_HOST} ^yoursite.com$
RewriteRule ^/?(.*)$ http://www.yoursite.com/$1 [R=301,L]
#Rewrites http://www.yoursite.com/subdir to http://www.yoursite.com/
RewriteCond %{REQUEST_URI} !^/subdir
RewriteRule ^(.*)$ subdir/$1 [L]

Replace your site with the name of your website & subdir with the Joomla directory

Also, change the configuration.php file.

Change
var $live_site = ”;
To
var $live_site = ‘http://www.yoursite.com/’;

Replace your with the name of your website



Related Articles

How To Activate SSL In OSCommerce
How To Reset My OSCommerce Password
What Is OSCommerce
How To Reset My Drupal Password
What Is Drupal

Can’t Find what you need?

No worries, Our experts are here to help.