Home Blog How to Redirect a domain to Joomla Subfolder?

How to Redirect a domain to Joomla Subfolder?

You can install your Joomla site in a subfolder rather than in a root folder. This will avoid all messy files in your root folder in your hosting drive. After you install in subfolder, you have to point your domain to sub folder.

To accomplish pointing your main domain  eg: ‘www.domain.com’ to go straight to joomla installation folder eg www.domain.com/joomla you need to add just the following code to your .htaccess file.

  • Go to folder public_html and there will be a .htaccess file there. make a copy (for backup) just in case.
  • In your  .htaccess find the line – RewriteEngine On
  • Under that add the code below. (replace domain with yourdomain and joomla with folder name for your joomla install)

RewriteCond %{HTTP_HOST} ^(www.)?domain.com$
RewriteCond %{REQUEST_URI} !^/joomla/
RewriteRule ^(.*)$ /joomla/$1
RewriteCond %{HTTP_HOST} ^(www.)?domain.com$
RewriteRule ^(/)?$ joomla/index.php [L]

Thats all you need ..now type in browser ‘www.domain.com’ and it will bring up your joomla website that is installed in subfolder /joomla

If you want multiple joomla installs on same server, with different joomla install folders and different domain names, you will need to use the cpanel. you can then set up in domain manager, set up as add on domain, and point to the folder with install.

If you are using Go Daddy for hosting then it makes it easier to do all the above. They have a domain forwarding with masking (to mask the sub-folders) feature built in to the admin section and a site redirecting feature

Disclaimer: MashTips is supported by its audience. When you purchase through links on our site, we may earn an affiliate commission at no extra cost to you.

1 COMMENT

  1. Hi Steve,
    Your snippet worked beautifully, however, it redirects only the home/index page. All my internal site links still point to the subdirectory url, which work fine, but show the subdirectory path in the url, including the home page after the first visit. Any idea how to achieve root-level redirect for all pages?

    Thanks for sharing.
    J

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Free Newsletter

Read More...

How do you copy a joomla site from localhost to a remote host?

When you are first trying out Joomla!, it is often recommended that you install it on your local system. (e.g., "localhost"), for example with...

7 Best Websites to Create QR Codes for URLs, Contacts, Etc.

There are several websites to create QR codes. QR codes are easy solution to transfer URLs, product information or data by scanning a code....

Best Free Educational Websites for Kids for the School

There are a bunch of educational websites for kids to learn new things and make their school life easy. These kids website can bring...

How to Create Google Forms Online for your Business?

Setting up a Google form is pretty simple and anybody can do without any coding experience. Before starting it, we need to finalize the...

How to Block Websites with OpenDNS on home WiFi?

OpenDNS is a free domain service that can be used to block individual websites on the home WIFi network. The configuration is pretty easy...

How to change written by in WordPress posts?

If you really thinking that you don't want to display Written by information in your blog or your are the only one person writing on the...
%d bloggers like this: