mod rewrite issue

Hello,

could anybody help me please, I am trying to create automatic subdomains, that is www.ws.cx/folder will automatically be accessible at folder.ws.cx...

I have added the following code to my httpd.conf file:

RewriteEngine on

RewriteCond ${lowercase:%{HTTP_HOST}} !^$
RewriteCond ${lowercase:%{HTTP_HOST}} !^www\.ws\.cx$

RewriteCond ${lowercase:%{HTTP_HOST}} ^(www\.|)([^.]+)\.ws\.cx$
RewriteRule ^(.+) ${lowercase:%{HTTP_HOST}}$1 [C]
RewriteRule ^(www\.|)([^.]+)\.ws\.cx(.*) /$2$3 [L]

RewriteCond ${lowercase:%{HTTP_HOST}} ^(www\.|)[^.]+\.[^.]+\.ws\.cx$
RewriteRule ^(.+) ${lowercase:%{HTTP_HOST}}$1 [C]
RewriteRule ^(www\.|)([^.]+)\.([^.]+)\.ws\.cx(.*) /$3/$2$4 [L]

I found this code after searching google.

It does not seem to work, can anybody please point me in teh right direction ?

thank you

Craig

 

 

 

 

Top