1

Codeigniter の URL から index.php を削除する際に問題が発生しました。

私のライブURL:「http://ec2-174-129-44-226.compute-1.amazonaws.com」ライブサーバーの問題

ローカルにも問題があります

以下のコードを使用してみました。

RewriteEngine on

RewriteCond $1 !^(index.php|resources|robots.txt)

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d`

RewriteRule ^(.*)$ index.php/$1 [L,QSA]

ただし、ローカルのワンプサーバーでエラーが発生します

"内部サーバーエラー

サーバーで内部エラーまたは構成ミスが発生したため、リクエストを完了できませんでした。

サーバー管理者の admin@localhost に連絡して、エラーが発生した時刻と、エラーの原因となった可能性のある操作を知らせてください。

このエラーの詳細については、サーバー エラー ログを参照してください。」

お願いします.....助けてください...私...ありがとう....

4

2 に答える 2

1

config.php を開き、次の置換を行います

$config['index_page'] = "index.php" 

と置換する

$config['index_page'] = ""

$config['uri_protocol'] = "AUTO" 

と置換する

$config['uri_protocol'] = "REQUEST_URI"

HTACCESS

RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA] 
于 2013-09-12T09:21:04.163 に答える
1

それを試してみてください。

config.php を開き、次の置換を行います

$config['index_page'] = "index.php"
to
$config['index_page'] = ""

uri_protocol のデフォルト設定が正しく機能しない場合があります。$config['uri_protocol'] ="AUTO" を $config['uri_protocol'] = "REQUEST_URI" に置き換えるだけです

HTACCESS

RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA] 
于 2013-08-31T12:39:18.113 に答える