You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "-=[ Julien Bonastre ]=-" <th...@the-spectrum.org> on 2002/07/19 17:23:42 UTC

[Apache] URL Rewriting / Subdomains

Hello All..


I have a small problem and I am sure it can be fixed via some neat htaccess trick ;)


The deal is. I have a server.. and in the root folder i have a htacess with a bit of subdomain stuff in it.. but I am trying to fix a "folder" prob..

Ok. here goes..


I have for example:
RewriteCond %{HTTP_HOST} abc.xyz.com
RewriteCond %{REQUEST_URI} !subs/abc/
RewriteRule ^(.*)$ subs/abc/$1 [L]


Ok.. Now this works fine.. and if I request abc.xyz.com I get the content from /subs/abc..


but.. when I get there and start browsing around I will see the links and images source is actually going to:
http://abc.xyz.com/subs/abc/ and then the subfolder and/or file name after that..

It seems to be whenever I decided to visit a subfolder of these subdomains that suddenly the "real" name seems to popup in the system..

for example..

if I decide to goto abc.xyz.com/thedir it does get the contents of xyz.com/subs/abc/thedir BUT it seems that now the urls in the page and images etc.. all have abc.xyz.com/subs/abc/ and then the filename of image/link etc..


Why is it that when I request folders it seems to rewrite the URL but it doens't seem to "hide" this /sub/abc path??


Also I have the CNAME *.xyz.com. setup so all subs goto the site where I process them with a htacess


But.. I have kinda got the rough handle of using sub.host.com but can I also use x.sub.host.com ??

is it possible to somehow parse the URL so it can, for example..goto a folder under that sub??


ok a example: I want thedir.sub.xyz.com and this will in reality load up sub.xyz.com/thedir but I'd like the URL to stay as thedir.sub.xyz.com if possible..

Can it be done??






Thank you SOO very much anyone and everyone for your time and assistance..

Thanks a million in advance ;)




\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\
\  Julien Bonastre [The_RadiX]
/  
\  The-Spectrum.org CEO
/  the_radix@the-spectrum.org
\  http://www.The-Spectrum.org
/
/\\//\\//\\//\\//\\//\\//\\//\\//\\//\\/\//\