i am having a bit trouble on my htaccess and maybe you could help me.
I want to redirect my requests like this:
www.fakedomain.mydomain.com/dev > www.mydomain.com/dev/events/fakedomain.php
The HTTP_HOST would be fakedomain.mydomain.com i guess, but the dev part is important too. My last try was :
RewriteCond %{HTTP_HOST} ^(www\.)?([^.]+)\.mydomain\.com [NC]
RewriteRule ^(.*)$ /dev/events/%2 [L]
This redirect is shown at the top of the browser, something I want to avoid.
Thank you for your time
If you are using your
DOCROOT/.htaccess
for this, you should use:The
(?!events/)
bit of the regexp is called a lookahead assertion and this prevents the rule matching/dev/events/something
and hence prevents a rewrite loop.If you are using your
DOCROOT/dev/.htaccess
for this, you should use:The
(?!events/)
bit of the regexp is called a lookahead assertion and this prevents the rule matching/dev/events/something
and hence prevents a rewrite loop.