View Full Version : Joomla Directory, Redirect, URL Display

01-26-2009, 04:36 PM
I checked through past posts but didn't find anything for this. I have several sites up, but this is my first Joomla site. Made it live today. I used the Westhost Joomla install untility and it automatically created/installed in the /joomla directory, so I have to do some sort of redirect to direct it there.

At first we tried the
Redirect permanent / http://www.example.com/
.htaccess file, but for whatever reason that didn't work and tech support wasn't sure why.

Then I created the
Redirect 301 file.html http://www.yourdomain.com/anotherfile.html
.htaccess file and that works fine, but now when I type in the URL it displays as www.example.com/joomla. I'd like it to mask and just display the main URL.

I suspect the answer will be a Rewrite Engine but I have no experience with these. Can anyone provide the exact command text? Thanks in advance!

01-28-2009, 09:08 AM
The better solution would be to move the installation of Joomla (http://www.joomla.org/) to the main directory. :) If you have not entered to much info in the WestHost install of Joomla (http://www.joomla.org/), you may want to simply install it manually. PHP programs like this are very easy to install yourself and it gives you a lot more control over it.

If you are going to install or manage the program yourself you are going to want to install phpMyAdmin. This can be done via SiteManager and is one php program I just let WestHost maintain.

01-31-2009, 10:45 AM
Did you ever get this working? I have a similar issue with my Drupal website.

02-04-2009, 03:24 PM
I would like some information on this as well. I have played around with mod_rewrite with some success, but I still get the sub-directory showing up when I click on a Joomla link.

I know it is easier to install joomla into the root, but I'm being stubborn and want it in a sub-directory. my reasons for this are:
1. Makes backing up my code easier
2. Makes installing upgrades easier
3. It's just a cleaner install

This is the way WestHost installs this app. Why doesn't anyone have information on how to reliably redirect your traffic into a subfolder.

Here is my current .htaccess file:

Options +FollowSymLinks
RewriteEngine On

#Rewrite non-www to www always
RewriteCond %{HTTP_HOST} ^domain.org [NC]
RewriteRule ^(.*) http://www.domain.org/$1 [R=301]

#the re-write to sub-directory, ignoring specific existing directories
RewriteCond %{HTTP_HOST} ^www.domain.org [NC]
RewriteCond %{REQUEST_URI} !^/joomla
RewriteCond %{REQUEST_URI} !^/atmail
RewriteCond %{REQUEST_URI} !^/manager
RewriteRule ^(.*)$ develop/$1 [L]

This works... to a point. It rewrites all my urls to include the www prefix, redirects the traffic to the /joomla sub-folder, and ignores requests for the /atmail and /manager subfolders.

What it doesn't do is remove the /joomla from the url once I click on something in joomla. I also get these weird errors in the error log:

/www/domain/.htaccess: Options not allowed here, referer: http://www.domain.org/

Help... please?

02-04-2009, 03:29 PM
This also breaks access to my subdomain: dev.domain.org which is pointing to the joomla subdirectory.

Can I have my cake and eat it too?

02-06-2009, 10:36 AM
Don't force folks to use www with your domain name :) No you can't have your cake and eat it too if you want to have www before your domain name.

Remember that you may need to change some settings in Joomla itself. That is the reason that urls in Joomla have /joomla as part of them. Not sure what config you need to change for sure since I don't use joomla regularly.