![]() |
Removing index.php in Codeigniter - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Removing index.php in Codeigniter (/showthread.php?tid=57759) |
Removing index.php in Codeigniter - El Forum - 04-09-2013 [eluser]faisal_memon[/eluser] I am not able to remove index.php from the url's http://sitename.com/index.php/controller-name/method-name I don't want index.php in above url. Explanation of what I want to achieve : Normally we access a view in codeigniter by Code: http://site-name/index.php/controller-name/method-name I don't want to use index.php in any of my urls. I want url's to be like - Code: http://site-name/controller-name/method-name Here is my .htaccess file Code: <IfModule mod_rewrite.c> Please help !! Removing index.php in Codeigniter - El Forum - 04-09-2013 [eluser]TheFuzzy0ne[/eluser] Welcome to the CodeIgniter forums! I assume you're using site_url()? If that's the case, you need to set $config['index_page'] to an empty string in ./application/config/config.php. Code: $config['index_page'] = ''; If that's not the problem, please can you explain what's happening? Are you getting an error? What's not working? What are the symptoms? Removing index.php in Codeigniter - El Forum - 04-10-2013 [eluser]Bigil Michael[/eluser] modify .htaccess like this Code: RewriteEngine on Removing index.php in Codeigniter - El Forum - 04-10-2013 [eluser]faisal_memon[/eluser] Here's what I want to achieve : Normally we access a view in codeigniter by Code: http://site-name/index.php/controller-name/method-name I don't want to use index.php in any of my urls. I want url's to be like - Code: http://site-name/controller-name/method-name @Bigil, Thanks for the reply. I tried your method, but its not working. Can you post the complete .htaccess file @TheFuzzy0ne, Thanks for the reply. I have already set Code: $config['index_page'] = ''; Am I missing anything ?? Guys !! Removing index.php in Codeigniter - El Forum - 04-10-2013 [eluser]TheFuzzy0ne[/eluser] I don't understand what you mean. What is the problem exactly? Are you generating your URLs without index.php in them? What happens when you manually type the URL into the address bar? Do you get a 500 error, a 404? Please give us an example of what you're doing, and the result you're getting. We understand what you want to achieve, we just don't understand why it's not working, so we need an actual usage example. Removing index.php in Codeigniter - El Forum - 04-10-2013 [eluser]TheFuzzy0ne[/eluser] [Duplicate] Removing index.php in Codeigniter - El Forum - 04-10-2013 [eluser]faisal_memon[/eluser] I am able to see the output when i put Code: http://site-name/index.php/controller-name/method-name I want to see the same output when I type following url(without index.php) in browser. Code: http://site-name/controller-name/method-name Eg : When you type Code: www.abc.com/index.php/welcome/hello I want to see the same welcome page when I type Code: www.abc.com/welcome/hello Removing index.php in Codeigniter - El Forum - 04-10-2013 [eluser]TheFuzzy0ne[/eluser] I know what you want to achieve. Now if you'd be so kind as to answer the questions I asked previously, I might be able to help you achieve it. When I asked for an example of what you're doing, I expected your reply to be something like this: I put this into my address bar: www.example.com/some_controller, and I got a 404 error. That's much more useful to the people trying to help you than repeating what it is you're trying to do for the third time. Now - What happens when you type the URL, in the desired format, into your browser's address bar? Removing index.php in Codeigniter - El Forum - 04-10-2013 [eluser]Edy S[/eluser] Hi faisal_memon , have you enable mod_rewrite on your apache web server? It would'nt be work if your apache web server have no mod_rewrite enable. Create a php file contain this code <?php phpinfo(); ?> the run it, check whether your mod_rewrite have been enable or not. If it not enable, you may open your apache config file httpd.conf and remove // beside mod_rewrite, restart your web server or your computer then check php info again. If your mod_rewrite have been enable, it should be work well Removing index.php in Codeigniter - El Forum - 04-11-2013 [eluser]faisal_memon[/eluser] @TheFuzzy0ne When I type Code: http://site-name/index.php/controller-name/method-name When I type Code: http://site-name/controller-name/method-name I want to see welcome page when I type Code: http://site-name/controller-name/method-name @Edy S mod_rewrite is enabled ![]() |