3

amazon ec2.htaccessの codeigniter index.php の削除が機能しない

コード

RewriteEngine on
RewriteBase http://ec2-xx-xxx-xx-xx.us-west-2.compute.amazonaws.com/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]

設定ファイル

$config['base_url'] = 'http://ec2-xx-xxx-xx-xx.us-west-2.compute.amazonaws.com/';
4

4 に答える 4

8
(if you use ubuntu)
Activate the mod_rewrite module with

     sudo a2enmod rewrite

and restart the apache

     sudo service apache2 restart

To use mod_rewrite from within .htaccess files (which is a very common use case), edit the default VirtualHost with

     sudo nano /etc/apache2/sites-available/000-default.conf

Search for “DocumentRoot /var/www/html” and add the following lines directly below:

    <Directory "/var/www/html">
        AllowOverride All
    </Directory>

Save and exit the nano editor via CTRL-X, “y” and ENTER.

Restart the server again:

     sudo service apache2 restart
于 2015-01-07T09:09:53.383 に答える