2017-06-28 5 views
1

を.htaccessファイルするためにweb.configファイルを変換する誰もが標準フロントコントローラパターンのように見える.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> 

答えて

0

このweb.configファイルを変換するために私を助けることができます。すなわち、既存のファイルまたはディレクトリにマップしないすべての要求を内部的にindex.php?permalink=<URL>に書き換えます。

ので、.htaccessでこのような何か:

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