Forum Moderators: phranque

Message Too Old, No Replies

subdomain mapping on path

         

wabi

11:28 am on Jun 18, 2004 (gmt 0)

10+ Year Member



I have a virtual server with several aliases whoes names I'd like to map to a path on the mainname of this server:
Example:

foo.domain.tld/bar
to
www.domain.tld/foo/bar

but
www.domain.tld/test
should stay
www.domain.tld/test

Now I'd think this is somehow possible with the RewriteEngine

Thanks for any help
wabi

wabi

12:55 pm on Jun 18, 2004 (gmt 0)

10+ Year Member



OK I found a static version but I think it should be possible to implement some variable version

RewriteEngine On
Options +FollowSymlinks
# Rewrite Rule for foo.domain.tld
RewriteCond %{HTTP_HOST} foo.domain.tld$
RewriteCond %{REQUEST_URI}!/foo/
RewriteRule ^(.*)$ /foo/$1

bar is the $1 respectiley (.*) on the last line

jdMorgan

3:04 pm on Jun 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



wabi,

Welcome to WebmasterWorld [webmasterworld.com]!

This recent thread [webmasterworld.com] may be of some help to you. It turns out that mapping arbitrary subdomains to subdirectories is rather tricky, but possible.

Jim