Please Help to remove index.php from url |
[eluser]GeLiNa[/eluser]
Hello, I'm a newbie in CodeIgniter. I followed the user guide, but I can't remove index.php from url. Condition: 1. I use Wamp Server. 2. My Base url is: http://localhost/trial/ 3. My CI url is: http://localhost/trial/application/ 4. I set $config['base_url'] = 'http://localhost/trial/'; and $config['index_page'] = ''; in config.php 5. I put the .htaccess file in the same folder with index.php (http://localhost/trial/) 6. My .htaccess file content: Code: RewriteEngine on and I've also tried some other .htaccess which I find in this forum, like: Code: RewriteEngine on I also tried to add this like some people in this forum suggest Code: RewriteBase /trial/ But the result is always same, and it happened even if I include the index.php in the url as long as the .htaccess file is there: Code: Internal Server Error I've tried many things in this forum, but none of them resolve it. Can someone help me, please?
[eluser]Tejas D[/eluser]
So, trial is your folder and structure may like this. -localhost -trial -application(rest all folders) create .htaccess file and save it in your trail folder with below contents- Code: <IfModule mod_rewrite.c> Also, - make sure mod_rewrite module is enabled. - $config[‘index_page’] = ‘’; in config.php
[eluser]GeLiNa[/eluser]
Hello Tejas D, thank you for helping. I've tried the solution you give, and there is a progress. It is now working for localhost/trial/ (without index.php), thanks to you, but if I continue with localhost/trial/category (to access category controller), I don't get the result I want, but I get localhost/ (but the url is written: localhost/trial/category)
[eluser]GeLiNa[/eluser]
Hello Tejas D, It is now working properly after I restart my Wamp Server. Thanks a lot. Best Regards, GeLiNa
[eluser]Tejas D[/eluser]
Hi Gelina Good to see some progress. This is my demo code of httpd.conf.(I am using LAMP) Code: ServerName localhost -> Check for the appropriate file or the file where you will find above structure in WAMP. -> Add or Edit the lines indicated by *. or simply copy those 5 lines which are under directory tag to your file. -> use your configuration for DocumentRoot and inside Directory tag(as I have "/var/www/"). -> Also, restart your server(WAMP) after editing files. Hope, this will work.
[eluser]Tejas D[/eluser]
Hi Gelina Good it is working properly,after you restarted WAMP. Sorry, I didn't saw your latest post, saying working now. So, Ignore my that httpd.conf post.(But i mentioned in that to restart your WAMP ![]() Regards, Tejas
[eluser]GeLiNa[/eluser]
Thank you, Tejas. Glad to have someone helpful like you :-) God bless you.
[eluser]ahmed.alsiddig[/eluser]
hi guys removing index.php didnt work for me i did all your steps but nothing please help Code: $config['base_url'] = 'http://localhost/altayyah/'; |
Welcome Guest, Not a member yet? Register Sign In |