将web.config设置转换为.htaccess

时间:2013-09-04 04:36:24

标签: php .htaccess web-config translate redirect

我在我的主机的.NET服务器上有这个工作配置文件,但我想转移到php 5.3,所以我可以使用Wordpress。无论如何,这就是那个人。 (它设置为两个不同的子域重定向到同一个子文件夹并在子栏中保留子域名。)

    <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>

 

非常感谢!

伊格纳西奥

1 个答案:

答案 0 :(得分:2)

我认为这应该有效:

<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>
相关问题