CodeIgniter Forums

Full Version: Help with .htaccess
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello guys,

I have this structure of files and folders:

Code:
framework
-- app
---- cache
---- config
---- controllers
---- models
---- ....
-- system
public
-- assets
---- css
---- js
---- ...
-- uploads
-- .htaccess (2)
.htaccess (1)


In the .htaccess nr. 1 i have:

Code:
<IfModule mod_rewrite.c>
   Options -MultiViews

RewriteEngine on

RewriteRule  ^$ public/    [L]
   RewriteRule  ((?s).*) public/$1 [L]
</IfModule>

In the .htaccess nr. 2 i have:

Code:
<IfModule mod_rewrite.c>
RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteRule ^((?s).*)$ index.php/$1 [QSA,L]
</IfModule>

The problem is:
1. When i access 127.0.0.1 it gives me CI error 404
2. When i access 127.0.0.1/public it display the welcome page

Can u help me a bit with this .htaccess files please?

Thanks.
I have read both articles that u gave me and found a lot of good things there but still didn't figure out my problem...
(03-07-2017, 06:03 AM)-V1cu- Wrote: [ -> ]I have read both articles that u gave me and found a lot of good things there but still didn't figure out my problem...

Where is your index.php file?
If your index.php file is in the public folder kindly move it out of the folder and place it in the root directory.