Author |
|
flatcircle
Joined: 27 Jun 2006 Posts: 79
|
Posted: Mon 11 Sep '06 23:02 Post subject: Reroute subdir to virtual site |
|
|
Hello,
Can't figure out how I can get this to work.
I have installed my default website (site1) on Apache.
By using virtual hosts, I added 2 other sites (site2 & site3).
When I go to: http://site1 , I get site 1. So far so good.
However I want to achieve that when users type in http://site1/site2
People are routed to site2.
Is there a way to route this subdirectory to 'site2'?
If possible an example of modrewrite (or something I have to use to get this done).
Regards. |
|
Back to top |
|
DeliriumServers
Joined: 17 Jun 2006 Posts: 54 Location: H Town
|
Posted: Mon 11 Sep '06 23:24 Post subject: |
|
|
an easy way would be to make an alias, then the request isn't processed so much each time as it would be with rewrite (although with just a few sites it's unnoticable anyways)
try this in your conf (of course changing everything to where site2 is located and make the paths correct (you don't need the directory definition here, i just felt like including, all you really need is the first line)
Code: | Alias /site2 "F:/www/site2"
<Directory "F:/www/site2">
AllowOverride All
Order allow,deny
Allow from all
</Directory> |
this means on any site you host if anyone does http://somesite/site2 it will draw the site out of the directory you have defined |
|
Back to top |
|
DeliriumServers
Joined: 17 Jun 2006 Posts: 54 Location: H Town
|
Posted: Mon 11 Sep '06 23:32 Post subject: |
|
|
if you still want a rewrite rule I recommend looking around http://forum.modrewrite.com/ they will either have one or if you request someone will make one for you, it's a very nice community
-delirium |
|
Back to top |
|
DeliriumServers
Joined: 17 Jun 2006 Posts: 54 Location: H Town
|
Posted: Mon 11 Sep '06 23:38 Post subject: |
|
|
oh I'm sorry I think I may have misunderstood your situation completely...
if you want http://site1/site2 to auto turn into http://site2 the easiest thing to do imo is to make a .htaccess redirect in the folder
make a .htaccess file in the site1 folder
and put this in it
Code: | Redirect /site2 http://site1.com/ |
make sure apache is listening for .htaccess files too, there should be a post somewhere in this forum about that.
hope I helped, sorry for all the posts |
|
Back to top |
|
flatcircle
Joined: 27 Jun 2006 Posts: 79
|
Posted: Tue 12 Sep '06 9:41 Post subject: Thanks! |
|
|
Thanks for the info!
Working like a charm. The Alias is also very handy
Regards. |
|
Back to top |
|
DeliriumServers
Joined: 17 Jun 2006 Posts: 54 Location: H Town
|
Posted: Tue 12 Sep '06 22:18 Post subject: |
|
|
glad I could help, so which way did you end up using? |
|
Back to top |
|