2016-11-26 5 views
0

CodeIngiterを初めて使用しており、私はURLアクセスの問題があります。 私はページにアクセスするためにURLにindex.phpを含める必要があります。AWSサーバーでCodeIgniter htaccessの問題

この問題を解決するために、私はhereで参照しました。 私はすべての手順に従った。

ルートに

$config['base_url'] = 'http://'.$_SERVER['SERVER_NAME'].'/Your Ci folder_name'; 
$config['index_page'] = ''; 
$config['uri_protocol'] = 'AUTO'; 

.htaccessファイルは、私がAllowOverrideのすべてに、すべてのAllowOverrideなしに変更することはできません

RewriteEngine On 
RewriteCond $1 !^(index\.php | assets | images | js | css | uploads | favicon.png) 
RewriteCond %(REQUEST_FILENAME) !-f 
RewriteCond %(REQUEST_FILENAME) !-d 
RewriteRule ^(.*)$ ./index.php/$1 [L] 

[email protected]:/var/www/html/CodeIgniter$ a2enmod rewrite 
Module rewrite already enabled 

であるように私はconfig.phpファイルに更新しました。 /etc/apache2/apache2.confファイルにあります。私がそれをすると、自分のルートURLにアクセスすることさえできません。 私の/etc/apache2/apache2.confファイルは以下の通りです。

# Sets the default security model of the Apache2 HTTPD server. It does 
# not allow access to the root filesystem outside of /usr/share and /var/www. 
# The former is used by web applications packaged in Debian, 
# the latter may be used for local directories served by the web server. If 
# your system is serving content from a sub-directory in /srv you must allow 
# access here, or in any related virtual host. 
<Directory /> 
     Options FollowSymLinks 
     AllowOverride None 
     Require all denied 
</Directory> 

<Directory /usr/share> 
     AllowOverride None 
     Require all granted 
</Directory> 

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

#<Directory /srv/> 
#  Options Indexes FollowSymLinks 
#  AllowOverride None 
#  Require all granted 
#</Directory> 




# AccessFileName: The name of the file to look for in each directory 
# for additional configuration directives. See also the AllowOverride 
# directive. 
# 
AccessFileName .htaccess 

私はapache2サーバーを再起動しました。

私のURLにはindex.phpがなくてもアクセスできません。 まだ間違っていますか?私の問題は、同様の問題があり、次のmod_rewrite.c

<IfModule mod_rewrite.c> 
    RewriteEngine On 
    Options +FollowSymlinks 

    # - - - Use for 1and1 - - - 
    # RewriteBase/

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

誰かを使用して解決した

答えて

0

、plsはこれを試してみてください。