[solved] can't get my path working... |
[eluser]m_ologin[/eluser]
Hi there, I have tried doing a simple web page with a form but get a 404 error, probably because I haven't configured my app right. Can someone please help? Here is my file structure: Code: +ci .htaccess: Code: <IfModule mod_rewrite.c> config.php: Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); index.php: Code: (...) routes.php: Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); login.php (in controller folder): Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); Now, when I go to http://localhost/ci/, it displays "ok" correctly. Yet, when I go to http://localhost/ci/login/submit, I have a 404 error. The page can only be found at http://localhost/ci/index.php/login/submit... Please advise. Thanks! [SOLVED] : I changed my <DIRECTORY> section to this: <Directory /> Options All AllowOverride All </Directory> in my httpd.conf apache file. Not great for security but I'm just working local for now... Thanks!
[eluser]Vicente Russo[/eluser]
Hi, Try this: <IfModule mod_rewrite.c> DirectoryIndex index.php RewriteEngine on RewriteBase /ci/ 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] </IfModule>
[eluser]m_ologin[/eluser]
No.. It still doesn't work. I have simplified my example (check above); but I still haven't managed to take out the index.php...
[eluser]brianw1975[/eluser]
IIRC AllowOverride All is the requirement for using mod_rewrite so just tweak your Options tag and you'll be fine. something like: Code: Options -Indexes -FollowSymlinks +FollowSymLinkIfOwnerMatch should keep all the baddies from getting access to junk outside the webroot - as long as *you* know what you are doing hehe |
Welcome Guest, Not a member yet? Register Sign In |