i'm trying to do an apache rewrite where if the term "admin" is contained in the request_uri
mydomain.com/admin/anything_else
re-write the host to use a subdomain
admin.mydomain.com/admin/anything_else.
likewise, if i click a link while in the admin.mydomain.com and it is a url WITHOUT "admin" in it, then i would like to rewrite the url back to
mydomain.com/anything_else
My question is. can regex do an exist check like that? I'm aware that it can do terms not matching (I don't know the syntax though...), but in this case I want regex to fail completely. Any ideas?
ReWriteCond [^(admin)]$
mydomain.com/admin/hi - matches mydomain.com/anything - doesn't match