htaccess |
[eluser]Bl4cKWid0w[/eluser]
I can't get my htaccess file to work correctly. I want to remove index.php from the url's, but the htaccess code from the guide messes everything up. How do I do this?
[eluser]Stefano G[/eluser]
Hi, there are many useful posts about this topic but... :p in the Code: application/configconfig.php Code: $config['index_page'] = ""; this is as important as the .htaccess file. Then you could use this file as your .htaccess file: Code: <IfModule mod_rewrite.c> Last but not least, are you sure that mod_rewrite is available on your provider's apache server? and are you sure that in YOUR localhost apache server is mod_rewrite enabled? If you installed XAMPP or similar make sure that everything's ok on that side as well! There is a method for checking that mod_rewrite is enabled: googling for "test if mod_rewrite enabled" I happened to open this page. Cheers! Stefano
[eluser]Bursh[/eluser]
I fixed this issue by placing the .htaccess file in the base folder; the same one as index.php appears in and just using the basic rewrite code provided by the user guide.
[eluser]Stefano G[/eluser]
[quote author="Bursh" date="1219371604"]I fixed this issue by placing the .htaccess file in the base folder; the same one as index.php appears in and just using the basic rewrite code provided by the user guide.[/quote] ...oops this is something I forgot to mention but I assumed it was obvious
[eluser]coldautumn[/eluser]
I was looking around for same topic, and found your discussion .I got same problem but the solution didnt make any difference. It gives following error message Quote:500 Internal Server Error I have removed index from other site, which is not based code igniter, and it worked okay. Proves that, mod_rewriting is enabled. I have placed the file on same level where index.php resides. Need suggestions. Thank you
[eluser]Stefano G[/eluser]
The Internal Server error is probably due either to a wrong configuration file (did you modify your httpd.conf recently?) or an error in your .htaccess file. The config file I have enclosed is suitable when you have codeigniter index.php file and .htaccess at the ROOT level of your server. if you have several projects on your htdocs folder Code: htdocs <--- root level then you should modify your .htacess as follows: Code: RewriteRule ^(.*)$ /mycodeigniterproject/index.php?/$1 [L] or Code: RewriteBase /mycodeigniterproject also remember to modify the Code: application/config/config.php as follows: Code: $config['base_url']= "http://localhost/mycodeigniterproject/"; <--- WITH a trailing slash!!! Hope it helps! Stefano
[eluser]coldautumn[/eluser]
Thanks for the guidance. Nope, that didnt resolve it. But removed the error message. Now shows Error 404 "Page not found". There is something missing in url, as its this => "http://localhost/Linked//welcome/skill" instead of being this => "http://localhost/Linked/welcome/skill"
[eluser]Stefano G[/eluser]
Have a look at your Code: application/config/routes.php mine is : Code: $route['default_controller'] = "start"; <--- WITHOUT slashes!!! so either if I type http://localhost/citestapp/start or http://localhost/citestapp/ I am redirected to the index method of my Start.php controller
[eluser]coldautumn[/eluser]
no problem with default controller as defined $route['default_controller'] = "welcome"; The .htaccess file include this RewriteRule ^(.*)$/Linked/index.php?/$1 [L] Havent add RewriteEngine on, as when I include the statment, html error 500 occurs, as mentioned before. Is there a way , I can confirm that apache is accepting htaccess directives and some good resource, where I could learn htaccess coding. Thanks for the guidance. |
Welcome Guest, Not a member yet? Register Sign In |