1

.htaccessで私はこれを書いた:

AddDefaultCharset UTF-8
RewriteEngine on

RewriteCond $1 !^(index\.php|images|test|css|js|files|wiki|sitemap\.xml|robots\.txt|favicon\.ico)
RewriteRule ^(.*)$ index.php/$1 [L]

しかし、私には2つの問題があります:

  1. http://example.com/ajax/index.php http://example.com/index.php/ajax/index.php変換しない
  2. ホワイトリストに登録されたディレクトリのリストを見ることができます。これを防ぐにはどうすればよいですか?
4

1 に答える 1

1

これを試して:

AddDefaultCharset UTF-8
RewriteEngine on

RewriteCond %{REQUEST_URI} !^(index\.php|images|test|css|js|files|wiki|sitemap\.xml|robots\.txt|favicon\.ico)
RewriteRule ^(.*)$ index.php/$1 [L]

Options All -Indexes
  • 最後の行はリスティングを修正する必要があり、条件でリクエスト uri を使用すると、書き換えを修正する必要があります。
于 2013-01-17T15:34:30.033 に答える