2017-09-07 8 views
0

codeigniterプロジェクトをサーバーにアップロードしました.URLからindex.phpを削除しようとしていません。 IPアドレスを使ってアクセスします。 http://ipアドレス/以下IPアドレスを使用してアクセスするとindex.phpが削除されます

は私のhtaccess

<Directory /var/www/> 
    Options Indexes FollowSymLinks 
    AllowOverride All 
    Require all granted 
</Directory> 

/etc/apache2/apache2.conf

<IfModule mod_rewrite.c> 
    RewriteEngine On 
    RewriteBase/
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteRule ^(.*)$ index.php?/$1 [L] 
</IfModule> 

であるように私はGoogleで見つけたすべての可能な解決策を試してみました。私のために働いていない。

答えて

1

いくつかのステップに従ってください:

  1. 後藤アプリケーション/設定/ config.phpの: $config['index_page'] = 'index.php';
    によって書き換えモードを有効に

  2. $config['uri_protocol'] = 'AUTO';

  3. $config['index_page'] = '';にと を交換します sudo a2enmod rewrite 次に service apache2 restart

  4. 次の.htaccessファイルを使用できます。

<IfModule mod_rewrite.c> RewriteEngine On RewriteBase/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule>

0
httpd.confの

、編集、または "index.phpを" 削除します。htaccessファイルに次に

<IfModule dir_module> 
    DirectoryIndex index.php 
</IfModule 

を、これを追加します。

オプション-Indexes

+0

私はないFINFのhttpd.confだけapache2.confは、/ etc/apache2の – hrishi

0

.htaccessファイル内のコードの下に追加します。この仕事を願っています。

Options All -Indexes 
RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php?/$1 [QSA,L] 
+0

それでも同じ問題 – hrishi

+0

オープンconfig.phpの中にあり、ブランク $の設定[ 'index_page']で置き換えることができます= ""; – Gaurav

+0

はい。すでに言及したのと同じです – hrishi

関連する問題