Z-man ([EMAIL PROTECTED]) was saying:
>
> Hi All
> Can Anyone here help me out?I'm trying to use the rewrite mod and have
> run into a problem.I've added the rewritecond and rules into my config
> file and it works if I use www in my url but will not work without
> it.I'd rather it worked the opposite way but will settle for both if
> that's the best I can do.The conditions I added are as follows:
>
Try this, notice the question marks after the (www\.), which shows that
it is optional.
Rewritelog logs/rewrite.log
RewritelogLevel 9
RewriteMap lowercase int:tolower
RewriteEngine on
RewriteCond ${lowercase:%{HTTP_HOST}} !^$
RewriteCond ${lowercase:%{HTTP_HOST}} !^www\.myserver.com$
RewriteCond ${lowercase:%{HTTP_HOST}} ^(www\.)?([^.]+)\.myserver\.com$
RewriteRule ^(.+) ${lowercase:%{HTTP_HOST}}$1 [C]
RewriteRule ^(www\.)?([^.]+)\.myserver\.com(.*) /users/$2$3 [L]
RewriteCond ${lowercase:%{HTTP_HOST}} ^(www\.)[^.]+\.[^.]+\.myserver\.com$
RewriteRule ^(.+) ${lowercase:%{HTTP_HOST}}$1 [C]
RewriteRule ^(www\.)?([^.]+)\.([^.]+)\.myserver\.com(.*) /users/$3/$2$4
[L]
>
> Do I need to change anything here or am I missing something?Also If it
> makes a difference I'm running apache on win2k.
> Thanks for any and all help...
> Denis
--
[EMAIL PROTECTED]
"With pain comes clarity."