I have this working config file on my host's .NET server but i wanted to move to php 5.3 so i can use Wordpress. Anyway, this is the guy. (It is set for two different subdomains redirecting to the same subfolder and keeping the subdomain name in the dir bar).
<rule name="atmittens.com.ar" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^(www.)?aastudio.com.ar$" />
<add input="{PATH_INFO}" pattern="^/aastudio/" negate="true" />
</conditions>
<action type="Rewrite" url="\aastudio\{R:0}" />
</rule>
<rule name="studioaa.com.ar" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^(www.)?studioaa.com.ar$" />
<add input="{PATH_INFO}" pattern="^/aastudio/" negate="true" />
</conditions>
<action type="Rewrite" url="/aastudio/{R:0}" />
</rule>
</rules>
Thank you very much!
Ignacio
I think this should work:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?aastudio.com.ar$
RewriteCond %{PATH_INFO} !^/aastudio/
RewriteRule .* \aastudio\$0 [L]
RewriteCond %{HTTP_HOST} ^(www.)?studioaa.com.ar$
RewriteCond %{PATH_INFO} !^/aastudio/
RewriteRule .* /aastudio/$0 [L]
</IfModule>