简体   繁体   中英

How to Converting web.config file to .htaccess

Can anybody help me to convert this web.config file to .htaccess

<rules>    
      <rule name="Rewrite to index" stopProcessing="true">
           <match url="^(.+)$" ignoreCase="true" />
            <conditions>
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
            </conditions>
           <action type="Rewrite" url="index.php?permalink={R:1}" />
      </rule>
</rules>

That looks like a standard front controller pattern. ie. Internally rewrite all requests to index.php?permalink=<URL> that don't map to an existing file or directory.

So, something like this in .htaccess :

RewriteEngine On
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php?permalink=$1 [L]

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