Welcome Guest, Not a member yet? Register   Sign In
I am despairing to REMOVE index.php out of my site. Please help!
#1

[eluser]Madthumb[/eluser]
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:

1. Install a fresh copy of CI 2.1.3, no any name change on any folders
2. Create a new .htaccess file to CI ROOT directory with all structures that I found on the Google
3. Change config[‘index_page’] to an empty, eg. config[‘index_page’] ='';
4. Set config['uri_protocol'] = 'REQUEST_URI' or 'QUERY_STRING'
5. Even restart the MAMP ( PHP 5.4) every time I made the change above
6. Enabled: LoadModule rewrite_module modules/mod_rewrite.so in httpd.conf
7. Add 'Options Indexes FollowSymLinks MultiViews' in https.conf ( the only thing I am not sure )
8. ( 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

:down: :down: :down: :down: :down: Please, can anyone light me up what should try next?


Here are some details of what I have now:

.htaccess file:

Code:
# 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>

httpd.conf file

Code:
#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>

host file
Code:
127.0.0.1 localhost
127.0.0.1 test.dev
127.0.0.1 ci.dev


config.php

Code:
$config['index_page'] = '';
$config['uri_protocol'] = 'QUERY_STRING';
//$config['uri_protocol'] = 'REQUEST_URI';





#2

[eluser]Aken[/eluser]
My MAMP install never required anything fancy. A fresh CI install could use this:

Code:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

Auto URI protocol should work fine. You've probably overcomplicated things after overlooking something simple. Remember that .htaccess rules can be as finicky as programming languages, too -- the question mark in the RewriteRule could make or break some installs.

What's generating the 404 error -- Apache or CI?
#3

[eluser]Madthumb[/eluser]
Thank you very much Aken, I think you are absolutely right man. I just install another copy of CI2 and use your .htaccess content, everything works~!!!!!!!!!!!!!!!!!!!!!!




Theme © iAndrew 2016 - Forum software by © MyBB