Converting IIS Redirect to .htaccess
- by user1641321
I am having trouble getting the rewrite to work on an apache server. The end result is so i can make subdomains on the fly just by adding a directory. For example anysubdomain.domain.com will redirect to domain.com/anysubdomain and still appear as anysubdomain.domain.com.
Is there anyone out there that convert this for me?
<rewrite>
<rules>
<rule name="Subdomain Redirect" patternSyntax="ECMAScript" stopProcessing="true">
<match url="^(.*)$" />
<conditions trackAllCaptures="true">
<add input="{HTTP_HOST}" pattern="^www\.obdevsite\.com" negate="true" />
<add input="{HTTP_HOST}" pattern="^(.*)\.obdevsite\.com" />
<add input="{REQUEST_URI}" pattern="^(.*)$" />
</conditions>
<action type="Rewrite" url="/{C:1}/{C:2}" appendQueryString="false" />
</rule>
</rules>
</rewrite>