I am a rewrite newbie, I am wondering why this rewrite rule is not working, it ceases Apache from starting
RewriteRule ^([-a-zA-Z0-9_]+)?/constant/([-a-zA-Z0-9_]+)/(.*)$ http://$2.domain.com/$1/$3 [R=301, NC]
What this rule should do is URL refactoring, examples:
http://www.domain.com/controller/constant/variable/action should be redirected to http://variable.domain.com/controller/action
and
http://www.domain.com/constant/variable should be redirected to http://variable.domain.com
basically /constant/variable should be detected, inserted in the subdomain and then removed
Please help me in this subtle problem that I am facing.
Thanks