Using subdomains when domain already rewritten?

Using a single web hosting account to host multiple sites

Using subdomains when domain already rewritten?

Postby twodomains » Thu Feb 10, 2005 2:13 am

I have two registered domain names that are hosted by the same ISP. Firstdomain.com points to /html and the seconddomain.com to /html/seconddomain.

The ISP has enabled using subdomains by rewriting. I can successfully add a subdomain sub.firstdomain.com by adding the needed code in .htaccess file in /html but cannot create a subdomain for secondomain.com

I guess this is because the seconddomain.com is already rewritten on a higher level. This is an example of the code ISP instructs to use for subdomains:

RewriteEngine On
Options +FollowSymlinks
RewriteBase /

RewriteCond %{HTTP_HOST} forum.domain.com$
RewriteCond %{REQUEST_URI} !forum/
RewriteRule ^(.*)$ forum/$1

I'm not so familiar with regexps that I could write one on my own for this purpose.
twodomains
 

Postby Caterham » Thu Feb 10, 2005 12:25 pm

where did you put the .htaccess for the rules for sub.seconddomain.com? In /html/seconddomain/.htaccess?

You can try it in the folder
/html/seconddomain/.htaccess wrote:
Code: Select all
RewriteEngine On
Options +FollowSymlinks
RewriteBase /

RewriteCond %{HTTP_HOST} sub.seconddomain.com$
RewriteCond %{REQUEST_URI} !sub/
RewriteRule ^(.*)$ sub/$1

and put the content for the subdomain into /html/seconddomain/sub/
Caterham
 
Posts: 690
Joined: Fri Dec 10, 2004 1:30 pm

Postby twodomains » Fri Feb 11, 2005 5:40 am

I tried to put it in /html/subdomain but it then redirects to seconddomain.com

No can do?
twodomains
 

Postby Caterham » Fri Feb 11, 2005 1:45 pm

Well, the configuration confuses me a little bit....

It would be logical if subdomains of the 2nd domain are located below the folder of the 2nd domain but not in the folder of the 1st domain...

Because there is no external redirect specifyed, I would recommend that you ask your provider if and how you can configure a subdomain of the second domain, because this is a local server configuration issue.
Caterham
 
Posts: 690
Joined: Fri Dec 10, 2004 1:30 pm

Postby twodomains » Tue Feb 22, 2005 2:19 am

I did and they answered that it's impossible but I hoped that there was a way to do it. The provider just wants to sell me more expensive service that I otherwise dont' need at all. More disk space, mailboxes etc. is offered if I want to use subdomains for both of my domains.
twodomains
 

Postby Caterham » Tue Feb 22, 2005 8:52 am

I think you are being redireted to 2nd-Domain.com, because of a entry within the server config to force an external redirect for every subdomain request like sub.2nd-Domain.com to 2nd-Domain.com....

Because this redirect takes place imediately, you cannot overrice this in an other way within your htdocs...
Caterham
 
Posts: 690
Joined: Fri Dec 10, 2004 1:30 pm


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 60 guests

cron