Obviously a pretty simple question: how do I rewrite
(value1).example.com/(value2)
to
/(value1)/(value2)
I’ve tried a couple of things without success.
Thank you in advance.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Try this rule:
Some explanation: My previous suggestion caused an infinite recursion as the L flag causes a restart of the rewriting process with the new URL:
The second condition will avoid this as it compares the subdomain part with the first path segment. And only if they are different the condition is true and the rewrite takes place.