Hi,
My domains are on a virtual server. public_html contains four folders, one for subdomainA, one for subdomainB, a folder called cgi-bin and folderA which contains an ecommerce script. The contents of folderA should really be on my primary domain, i.e. public_html, but the installation for the ecommerce said it should be kept in a separate folder for security reasons or otherwise.
public_html => cgi-bin (folder)
public_html => folderA (folder)
public_html => subdomainA (folder)
public_html => subdomainB (folder)
public_html also contains .htaccess file to redirect to folderA when address of primary domain is typed in.
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/folderA [NC]
RewriteRule ^(.*)$ /folderA/$1 [L]
If the primary domain address is typed the .htaccess file takes the person to folderA. The trouble with this is if either of the addresses of the subdomains is typed the system looks in folder A for the subdomains and an error is produced.
Not Found
The requested URL /folderA/subdomainA.com/ was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
What I really need is to alter the .htaccess file to something like this:
if(address of primary domain) go to folderA;
else if (address of subdomainA) go to folder subdomainA;
else if (address of subdomainB) go to folder subdomainB;
Would this be possible? If not how can I get around the above problem? All help would be greatly appreciated.
My domains are on a virtual server. public_html contains four folders, one for subdomainA, one for subdomainB, a folder called cgi-bin and folderA which contains an ecommerce script. The contents of folderA should really be on my primary domain, i.e. public_html, but the installation for the ecommerce said it should be kept in a separate folder for security reasons or otherwise.
public_html => cgi-bin (folder)
public_html => folderA (folder)
public_html => subdomainA (folder)
public_html => subdomainB (folder)
public_html also contains .htaccess file to redirect to folderA when address of primary domain is typed in.
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/folderA [NC]
RewriteRule ^(.*)$ /folderA/$1 [L]
If the primary domain address is typed the .htaccess file takes the person to folderA. The trouble with this is if either of the addresses of the subdomains is typed the system looks in folder A for the subdomains and an error is produced.
Not Found
The requested URL /folderA/subdomainA.com/ was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
What I really need is to alter the .htaccess file to something like this:
if(address of primary domain) go to folderA;
else if (address of subdomainA) go to folder subdomainA;
else if (address of subdomainB) go to folder subdomainB;
Would this be possible? If not how can I get around the above problem? All help would be greatly appreciated.