I am a person who likes to keep everything organized under the /public_html/ folder. If you like to keep all the Joomla! files under a "joomla" folder or named whatever, you can do so and have your website redirect to the "joomla" directory without typing yoursiteurl.com/joomla. I use Joomla 1.5 so I know it works with 1.5.
Create a .htaccess file under your /public_html/ folder. If you already have one there, great. If not create a text file in Microsoft Notepad and name it simply ".htaccess" with no file extension. Paste the following in the file:
Rename all the "domain.com" in the code to your site url (yourdomain.whatever). You will need to rename the "folder" to "joomla" or whichever subdirectory your Joomla files are housed in. Joomla! uses an index.php file but if you decide to apply this to your own site that uses an html index page, simply rename the "index.php" to "index.html" or whatever.
Then go to the folder where your Joomla! files are located and find "configuration.php" under your Joomla root. Open the file in your favorite editor and find the line (if you can't find it just create one):
and replace it with:
That's it! Go to your website root and it should be redirected to your Joomla! subdirectory.
Create a .htaccess file under your /public_html/ folder. If you already have one there, great. If not create a text file in Microsoft Notepad and name it simply ".htaccess" with no file extension. Paste the following in the file:
Code:
# Turn on rewrites.
RewriteEngine on
# Only apply to URLs on this domain
RewriteCond %{HTTP_HOST} ^(www.)?domain.com$
# Only apply to URLs that aren't already under folder.
RewriteCond %{REQUEST_URI} !^/folder/
# Don't apply to URLs that go to existing files or folders.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Rewrite all those to insert /folder.
RewriteRule ^(.*)$ /folder/$1
# Also redirect the root folder.
RewriteCond %{HTTP_HOST} ^(www.)?domain.com$
RewriteRule ^(/)?$ folder/index.php [L]
Rename all the "domain.com" in the code to your site url (yourdomain.whatever). You will need to rename the "folder" to "joomla" or whichever subdirectory your Joomla files are housed in. Joomla! uses an index.php file but if you decide to apply this to your own site that uses an html index page, simply rename the "index.php" to "index.html" or whatever.
Then go to the folder where your Joomla! files are located and find "configuration.php" under your Joomla root. Open the file in your favorite editor and find the line (if you can't find it just create one):
Code:
$mosConfig_live_site = 'http://mydomain.whatever/joomla';
and replace it with:
Code:
$mosConfig_live_site = 'http://mydomain.whatever';
That's it! Go to your website root and it should be redirected to your Joomla! subdirectory.
Last edited: