Moving Codeigniter Project to Amazon EC2, htaccess and ModRewrite Problems
I am attempting to move my Codeigniter projects from a shared hosting service to Amazon EC2 and am running into some challenges with my .htaccess settings. These settings enabled me to not have to include index.php in the url. My previous .htaccess is shown below and worked as expected with my previous hosting provider:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /simple.com/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>
With my Amazon EC2 instance, I now have full access to the LAMP stack and have confirmed that the Apache Mod_Rewrite module is enabled.
I have set up my EC2 instance with two Virtual Host directories, one for each of my sites. Both sites serve up their CI applications as expected, but require index.php to be in the url.
I've tried inserting my Amazon EC2 public path into the .htaccess file as follows but still no luck:
RewriteBase /ec2-55-27-191-14.compute-1.amazonaws.com/simple/
I am sure this is 100% user error on my part a开发者_如何转开发nd would greatly appreciate your diagnosis!
To answer my own question...
I wound up changing the Apache file /etc/apache/sites-available/default from AllowOverRide = None to AllowOverRide = All.
have you also tried
RewriteBase /
or RewriteBase /simple/
or along those lines?
in my dealings on servers i've used, i've never had to put the domain into the rewrite base. Just the folders
精彩评论