0

.htaccessこれをに変更する必要がありweb.configます。サーバーは IIS で、PHP アプリケーションをサーバー上で実行したい

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|robots\.txt)
RewriteRule ^(.*)$ index.php/$1

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(application|modules|plugins|system|themes) index.php/$1 [L]
4

1 に答える 1

0

IIS がインストールされている場合は、マネージャーを開き、任意のサイトをクリックして [URL 書き換え] をクリックし、右側のパネルでインポート ルールを選択して、.htaccess ルールを貼り付けます。

<rewrite>
  <rules>
    <rule name="Imported Rule 1">
       <match url="^(.*)$" ignoreCase="false" />
      <conditions>
         <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
    <add input="{R:1}" pattern="^(index.php|robots.txt)" ignoreCase="false" negate="true" />
  </conditions>
  <action type="Rewrite" url="index.php/{R:1}" />
</rule>
<rule name="Imported Rule 2" stopProcessing="true">
  <match url="^(application|modules|plugins|system|themes)" ignoreCase="false" />
  <conditions>
    <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
  </conditions>
  <action type="Rewrite" url="index.php/{R:1}" />
</rule>

于 2012-08-29T12:48:00.327 に答える