getting a not found error |
I am having trouble getting .htaccess (or 000-default.conf) to work. I am following the instructions in docs/installation instructions. My root as defined in config.php is $config['base_url'] = 'http://localhost/sub_crud'. I am following these directions:
Removing the index.php file By default, the index.php file will be included in your URLs: example.com/index.php/news/article/my_article If your Apache server has mod_rewrite enabled, you can easily remove this file by using a .htaccess file with some simple rules. Here is an example of such a file, using the “negative” method in which everything is redirected except the specified items: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] In my case I do have mod rewrite enabled. I also modified .htaccess in the /var/www/html/sub_crud directory to include: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] But I still get http://localhost/sub_crud/Configure/index which fails because it is missing (correctly) index.php in the URI. I am stuck. Any ideas?
proof that an old dog can learn new tricks
Solved. I needed to set config[index]="index.php". On my windows PC and on my aws server I do not need this. Why it is needed on Ubuntu?
proof that an old dog can learn new tricks
Hi,
My best guess is mod_rewrite is not working properly. One way to check is to run phpinfo and look at the Loaded Modules in apachehandler if mod_rewrite is listed. Or look in your /etc/httpd/config/httpd.conf if LoadModule rewrite_module .... is commented. A good decision is based on knowledge and not on numbers. - Plato
If you think it is an .htaccess problem you can use this .htaccess file from FuelPHP
that has always worked for me because it covers all environments. Code: <IfModule mod_rewrite.c> Save as .htaccess What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |