RewriteEngine, DirectoryIndex in .htaccess CodeIgniter application file
I just changed the contents of the .htaccess file and as shown below in the links . And I tried to refresh the page (which did not work and could not find a request to my controller), it worked.
Then, just because of my doubts, I canceled the changes that I made with my .htaccess inside my public_html folder to the original .htaccess content, so now now (what was originally):
DirectoryIndex index.php RewriteEngine on RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ ./index.php?/$1 [L,QSA]
And now it also works.
Tip: It seems that before the rewrite rules were not clearly configured in the server context.
My file structure is as follows:
/ |- gheapp | |- application | L- system | |- public_html | |- .htaccess | L- index.php
And in index.php I set the following paths to the system and application:
$system_path = '../gheapp/system'; $application_folder = '../gheapp/application';
Note: by doing this, our application source code is first hidden to the public.
Please, if you guys find something wrong with my answer, please comment and review me!
Hope beginners find this answer helpful.
Thank!
Kasun Randika Nov 22 '14 at 6:57 2014-11-22 06:57
source share