Before I open this post, I did spent three days try to figure out this, but no luck at all, so please help me out. Thanks~~~~
Ok, this is what I’ve done so far:
- Install a fresh copy of CI 2.1.3, no any name change on any folders
- Create a new .htaccess file to CI ROOT directory with all structures that I found on the Google
- Change config[‘index_page’] to an empty, eg. config[‘index_page’] =’‘;
- Set config[‘uri_protocol’] = ‘REQUEST_URI’ or ‘QUERY_STRING’
- Even restart the MAMP ( PHP 5.4) every time I made the change above
- Enabled: LoadModule rewrite_module modules/mod_rewrite.so in httpd.conf
- Add ‘Options Indexes FollowSymLinks MultiViews’ in https.conf ( the only thing I am not sure )
- ( I have no idea what should I try now V_V )
Then, I got this:
yes working: http://ci.dev/index.php/welcome/index
not working: http://ci.dev/welcome/index
Here are some details of what I have now:
.htaccess file:
# I got 500 error if I uncommend this line: <IfModule mod_rewrite.c>
#http://ci.dev/index.php/welcome/index this is works fine only if the above line commend out
RewriteEngine On
RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/?$1 [L]
# I got 500 error if I uncommend this line: </IfModule>
config.php
$config['index_page'] = '';
$config['uri_protocol'] = 'QUERY_STRING';
//$config['uri_protocol'] = 'REQUEST_URI';
host file
127.0.0.1 localhost
127.0.0.1 test.dev
127.0.0.1 ci.dev
httpd.conf file
#the following line also enabled
LoadModule rewrite_module modules/mod_rewrite.so in httpd.conf
...
# The following code I placed at the bottom of https.conf file
NameVirtualHost *
<VirtualHost *>
ServerName localhost
DocumentRoot "/Applications/MAMP/htdocs"
</VirtualHost>
<VirtualHost *>
ServerName ci.dev
DocumentRoot /Users/coda/Sites/ci
<Directory /Users/coda/Sites/ci>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
</VirtualHost>
<VirtualHost *>
ServerName test.dev
DocumentRoot /Users/coda/Sites/test
</VirtualHost>
Please HELP ME OUT ~~~~
Thanks
=================================================================
Thanks everyone who try to help me out here. I finally got it works, I think somehow I overcomplicated things after overlooking something simple.
I just install another copy of CI2 and only change the .htaccess file with:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
Then, it all works~!!!! –
