This is useful for sites with many sub-domains or multiple domains hosted in the same hosting account.

 

Example:

To make
subdomain.yourdomain.com/
point to
yourdomain.com


The example below assumes that your root public directory (where you would put this .htaccess file) is htdocs, which is the default setup for Apache. If your setup is different, then you may need to adjust the examples accordingly. This approach has you code the first part of the domain or subdomain name and the associated subdirectory in your .htaccess file.

Change .htaccess in root directory to the following:

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_URI} !^/subdirectory/

RewriteCond %{HTTP_HOST} ^(www\.)?newdirectoryname\.

RewriteRule ^(.*)$ subdirectory/$1 [L]


And add this code to the .htaccess file in the subdirectory that is the exception to the above rule:



RewriteEngine Off
subdirectory>
ForceType application/x-httpd-php

This is useful for sites with many sub-domains or multiple domains hosted in the same hosting account.

 

Example:

To make
subdomain.yourdomain.com/
point to
yourdomain.com


The example below assumes that your root public directory (where you would put this .htaccess file) is htdocs, which is the default setup for Apache. If your setup is different, then you may need to adjust the examples accordingly. This approach has you code the first part of the domain or subdomain name and the associated subdirectory in your .htaccess file.

Change .htaccess in root directory to the following:

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_URI} !^/subdirectory/

RewriteCond %{HTTP_HOST} ^(www\.)?newdirectoryname\.

RewriteRule ^(.*)$ subdirectory/$1 [L]


And add this code to the .htaccess file in the subdirectory that is the exception to the above rule:



RewriteEngine Off
subdirectory>
ForceType application/x-httpd-php

Joomla! Debug Console

Session

Profile Information

Memory Usage

Database Queries