简体   繁体   中英

Convert simple htaccess to web.config

I have htaccess and I want to write same functioning in web.config but don't have any knowledge of it, please help. Below is my htaccess code:

<IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^$ app/webroot/ [L] RewriteRule (.*) app/webroot/$1 [L] </IfModule>

From your tags I assume your using IIS7 URL Rewrite Module? If so then:

<system.webServer>
    <rewrite>
        <rules>
            <rule name="all">
                <match url=".*"/>
                <action type="Redirect" url="app/webroot/{R:0}" redirectType="Permanent"/>
            </rule>
        </rules>
    </rewrite>
</system.webServer>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM