Alias for htaccess

Alias for htaccess

am 21.12.2009 13:12:34 von Jaap

Hi,

I know you cannot use the Alias directive in htaccess but I was
wondering if I can achieve something similar to that.

I have the following problem. With my hosting provider I can add more
domains to my main domain with which I registered. However they have
to be in subdirectories

To be more precise, my main domain (e.g www.maindomain.com) is in the directory
/public_html
and my add on domain can then be in
/public_html/www.addondomain.com

What I want is that my main domain is in
/public_html/www.maindomain.com

I've asked my hosting provider and they say they cannot do this. So I
was wondering if there is a trick on how to this with for example an
htaccess file

Thanks

Jaap

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

Re: Alias for htaccess

am 21.12.2009 15:20:41 von Eric Covener

On Mon, Dec 21, 2009 at 7:12 AM, Jaap A. Haitsma wrote:
> Hi,
>
> I know you cannot use the Alias directive in htaccess but I was
> wondering if I can achieve something similar to that.
>
> I have the following problem. With my hosting provider I can add more
> domains to my main domain with which I registered. However they have
> to be in subdirectories
>
> To be more precise, my main domain (e.g www.maindomain.com) is in the directory
> /public_html
> and my add on domain can then be in
> /public_html/www.addondomain.com
>
> What I want is that my main domain is in
> /public_html/www.maindomain.com

for .htaccess in your document root this will probably give you a good start:

RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^(www\.)maindomain.com$
RewriteCond %{REQUEST_FILENAME} !www.maindomain.com
RewriteRule (.*) /public_html/www.maindomain.com/$1

--
Eric Covener
covener@gmail.com

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

Re: Alias for htaccess

am 21.12.2009 15:56:29 von aw

Eric Covener wrote:
> On Mon, Dec 21, 2009 at 7:12 AM, Jaap A. Haitsma wrote:
>> Hi,
>>
>> I know you cannot use the Alias directive in htaccess but I was
>> wondering if I can achieve something similar to that.
>>
>> I have the following problem. With my hosting provider I can add more
>> domains to my main domain with which I registered. However they have
>> to be in subdirectories
>>
>> To be more precise, my main domain (e.g www.maindomain.com) is in the directory
>> /public_html
>> and my add on domain can then be in
>> /public_html/www.addondomain.com
>>
>> What I want is that my main domain is in
>> /public_html/www.maindomain.com
>
> for .htaccess in your document root this will probably give you a good start:
>
> RewriteEngine on
> RewriteBase /
> RewriteCond %{HTTP_HOST} ^(www\.)maindomain.com$

or rather :
RewriteCond %{HTTP_HOST} ^(www\.)?maindomain.com$

?

> RewriteCond %{REQUEST_FILENAME} !www.maindomain.com
> RewriteRule (.*) /public_html/www.maindomain.com/$1
>


------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

Re: Alias for htaccess

am 21.12.2009 15:58:02 von Eric Covener

On Mon, Dec 21, 2009 at 9:56 AM, Andr=E9 Warnier wrote:

>> RewriteCond %{HTTP_HOST} ^(www\.)maindomain.com$
>
> or rather :
> RewriteCond %{HTTP_HOST} ^(www\.)?maindomain.com$

yep

--=20
Eric Covener
covener@gmail.com

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

Re: Alias for htaccess

am 23.12.2009 01:46:56 von jaap.haitsma

Thanks for your help. It now works like a charm

Jaap

On Mon, Dec 21, 2009 at 15:58, Eric Covener wrote:
> On Mon, Dec 21, 2009 at 9:56 AM, Andr=E9 Warnier wrote:
>
>>> RewriteCond %{HTTP_HOST} ^(www\.)maindomain.com$
>>
>> or rather :
>> RewriteCond %{HTTP_HOST} ^(www\.)?maindomain.com$
>
> yep
>
> --
> Eric Covener
> covener@gmail.com
>
> ------------------------------------------------------------ ---------
> The official User-To-User support forum of the Apache HTTP Server Project=
..
> See for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> =A0 " =A0 from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org