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?
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