Forum Moderators: phranque

Message Too Old, No Replies

Easy, but I'm new.

         

rashid

3:23 am on Feb 3, 2004 (gmt 0)

10+ Year Member



I have adreess like:

www.myzite.com/store1

And in the folder store1 I have the index.php, but I would like to take address like

www.store1.myzite.com

It is possible?
How must be the rewrite rule?

Thanks.

decdim

4:23 am on Feb 3, 2004 (gmt 0)



Readup at:

http:httpd.apache.org/docs/vhosts/index.html

---
The following "code snippet" may work, but you will have to edit based on your site (chaning domain, tld, etc.). Any edits by other users would be appreciated (or comments):

RewriteEngineon
RewriteMap lc int:tolower
RewriteCond %{HTTP_HOST} ^domain\.com$ [NC]
RewriteRule ^(.+) - [L]
RewriteCond %{HTTP_HOST} !\.domain\.com$ [NC]
RewriteRule ^(.+) - [L]
RewriteCond %{HTTP_HOST} ^[^.]+\.domain\.com$ [NC]
RewriteRule ^/icons/(.+) - [PT,L]
RewriteRule ^(.+) %{HTTP_HOST}=$1 [C]
RewriteRule ^(.*)=(.*) ${lc:$1}$2 [C]
RewriteRule ^([^.]+)\.domain\.com(.*) /server/path/to/htdocs/$1$2