[thelist] .htaccess for two URLs

Eduardo Kienetz eduardok at gmail.com
Mon Jun 4 15:59:39 CDT 2007


On 6/4/07, Fred Jones <fredthejonester at gmail.com> wrote:
> >> I have two domain names and I want the secondary one to be sent to a
> >> subdirectory, meaning that if you request
> >> http://secondsite.com/aboutus.php the server will deliver
> >> http://mainsite.com/secondsite/aboutus.php
> >>
> >> I tried this
> >>
> >> RewriteCond %{HTTP_HOST} !mainsite.com
> >> RewriteRule ^(.*)$ /secondsite/$1
> >>
> > Have you tried this:
> >
> > RewriteEngine on
> > RewriteCond %{HTTP_HOST} !mainsite.com
> > RewriteRule ^(.*)$ /secondsite/$1 [R,L]
>
> Also fails. I enter secondsite.com and get
> mainsite.com/secondsite/secondsite/secondsite ad infinitum until it errors.
>
> I also tried
>
> RewriteRule ^(.*)$ http://mainsite.com/secondsite/$1 [R,L]
>
> and while it works, it changes the URL in the browser, which I don't want.
>
> Fred

Do you have full access (not shared/own machine) to this machine's httpd.conf?
If positive you could accomplish this via Apache's reverse proxy.

Did you try this:

RewriteEngine On
RewriteRule ^(.*) http://mainsite.com/secondsite/$1

?

Regards,

-- 
Eduardo Bacchi Kienetz
LPI Certified - Level 2
http://www.noticiaslinux.com.br/eduardo/



More information about the thelist mailing list