Mod_rewrite with folders in views [SOLVED] |
[eluser]Ludovic-r[/eluser]
Without index.php : http://localhost:8888/website/controller/function/ With : http://localhost:8888/website/index.php/.../function/
[eluser]InsiteFX[/eluser]
Map a new route in the application/config/routes.php file! CodeIgniter User Guide -URI Routing InsiteFX
[eluser]Zaher Ghaibeh[/eluser]
mapping the URI is not the best scenario but it might solve the problem .. i think its something related to the CI itself .. can you try to get an old version lets say 2.0.0 or try to change to the CORE one .. for me i switched to the CORE since i need something stable..
[eluser]Ludovic-r[/eluser]
The routing methode doesn't seems to work, my urls stay as they are. Any ideas?
[eluser]d1a8lo24[/eluser]
I have run into a lot of problems with this specially trying to deploy an application in different server environments so this is what i do to narrow down the problems. 1. first make sure that mod_rewrite is enable and that the server is allowed to read the htaccess file from the folder, I had this problem when I first try to run my own server using ubuntu. You can read here for my solution http://ellislab.com/forums/viewthread/184961/ 2. Try the following .htaccess code Code: <IfModule mod_rewrite.c> If that doesn't work try looking at your error logs for any other errors.
[eluser]Ludovic-r[/eluser]
Hi, thanks for your answer, where should I put the : <Directory /directory/path> AllowOverride all </Directory> please, many thanks!
[eluser]d1a8lo24[/eluser]
Depending on your server setup there are 3 place where you can specify which mods or configurations can be loaded or set. These are the following files just do a search for them apache2.conf httpd.conf The following I think only applies to unix servers and I think mosly ubuntu. Under you sites-enable folder the file that enables a new or default site can also have this configurations. First check to see if the configuration is anywhere on these files do a qucik search for AllowOverride. <Directory /directory/path> AllowOverride all </Directory> And they all should be where your apache server installation is. Try the new .htaccess first and then if it doesn't work try this solution only if the server setup is not allowed to read the .htaccess file on the root directory. By the way you can open these files on most code editors.
[eluser]Ludovic-r[/eluser]
Ok, I have the AllowOverride all enabled, but the index.php remain in my urls and I can't figured out how to remove that T_T The .htaccess is working, I've removed the "index.php" in my CI config file, everything seems to be ok because when I click on a link in my page the index.php is well removed from the url but it sill gives me a 404 error I'm desesperate..
[eluser]d1a8lo24[/eluser]
At this point the only thing that will be a next step is if you have a live server upload your app and see if it works. also the following link might help you a little more these are great tutorials i know that either in the first or second video they explain how to remove the index.php. http://net.tutsplus.com/sessions/codeign...m-scratch/ One last test on your local server. remove everything from your root folder make sure you backup your work. Download afresh CI install do your standard configurations, add the htaccess file on the root folder. And now create a new testing controller you don't have to create a new view just echo anything out. and got to your URL http://localhost/testing see if that works. Make sure your testing controller is not your main controller , just leave the welcome controller as is. If you still get an error then your server setup is the problem if not then you need to review your code. |
Welcome Guest, Not a member yet? Register Sign In |