Eliminating the index.php |
[eluser]GabrieleMartino[/eluser]
Hello, i have changed $config['index_page'] = ''; I have tried with several .htaccess and i could not understand if is necessary to write them this way Code: <IfModule !mod_rewrite.c> or this way Code: RewriteEngine on as in the guide. Anyway they doesn't work both. Neither if i change the $config['uri_protocol'] = ... in the 5 possible values
[eluser]CroNiX[/eluser]
Try: Code: RewriteEngine On
[eluser]GabrieleMartino[/eluser]
I mean when i call an method should i put the index.php/controller/method or not like conroller/method. Because before it works the second but i have to create a htaccess for being read by the host.
[eluser]CroNiX[/eluser]
It should make it work without index.php in the url. So you should be able to go to http://yoursite.com/controller/method, but yes, you need the htaccess in order to do that. The purpose of that htaccess is so that you don't HAVE to have index.php appear in the url, but it will still work if it is there. If you are using site_url() helper to generate your links, then it will automatically add index.php (or not) depending on the $config['index_page'] setting. If it is set to 'index.php', then it will add index.php to the urls. If it is blank, it won't use index.php in the url and you then need the htaccess to make it work.
[eluser]GabrieleMartino[/eluser]
The system do not work with the .htaccess. I reported with firebug: 404 Not Found for controller/method Other element in the page are not properly load. NetworkError: 404 Not Found - http://localhost/safememoirs/pages/get_secondary" which is called inside javascript with Code: $.ajax({
[eluser]CroNiX[/eluser]
Are you sure that you have mod_rewrite enabled as an apache module? It also looks like you have your CI installed in a subdirectory (safememoirs), instead of document_root, so additional work will probably need to be done. Its much simpler setting up a virtual host in apache for each project. You could try adding RewriteBase /safememoirs/ to your htaccess (just after RewriteEngine On) to fix that, but you'd have to change it again on your live site, which is why it's really best to set up a virtual host so your development site will mimic the live site as far as the structure.
[eluser]GabrieleMartino[/eluser]
I had the module switched off by defualt in the apache config on opensuse. Anyway it seems not read the .htaccess file. What is the exact name of the file .htaccess ? Or there is a prefix to give? Is it possible to have another .htaccess that is not possible to overwrite with the one in localfolder?
[eluser]Rowan Wilson[/eluser]
Try this one: Code: RewriteEngine on The filename is how you've already written it: .htaccess and it must live in the root of your CI installation at the same level as application and system. FYI the dot in the filename makes it a hidden file if you are looking for it in the terminal.
[eluser]GabrieleMartino[/eluser]
This is not working, but i have a doubt Do I have to remove the file index.php from root, deleting it I mean? Because if so can be It doesnt' start for IDE configuration and not for .htaccess! If so I'm sorry, but It as not been unuseful the help.
[eluser]Rowan Wilson[/eluser]
No don't delete index.php. That's the main CI script. Just put a file called .htaccess in the root of your CI folder. |
Welcome Guest, Not a member yet? Register Sign In |