the dreaded mod_rewrite mac snow leopard its working but not for CI |
[eluser]simon_davies[/eluser]
Now I believe i have mod rewrite working as I have run an independent small test script and this seems to be working fine. Now when I go into my CI files etc its does not seem to work. a little bit about the structure for more information. Settings: Code: $config['base_url'] = 'http://localhost/SITEFOLDER/cms/'; htaccess file This file is located within the applications folder with the following code within Code: RewriteEngine On If i have the following within the url Code: http://localhost/SITEFOLDER/cms/index.php/mgr Code: http://localhost/SITEFOLDER/cms/index.php/mgr work fine then clicking a submit button takes me to Code: http://localhost/SITEFOLDER/cms/mgr/mainmenu now this does not work because I have removed the index.php from the config fiel above, but if I link it with the the index.php name in there it works as below: Code: http://localhost/SITEFOLDER/cms/index.php/mgr/mainmenu Now my externally settings like apache / config files seem to all be ok as I have run a separate folder / site with a mod_rewrite test code and all seems ok so must be something I am or missing in my code but have followed what i have found. I have also added a .htaccess file with the following within the root of the following folder: Code: http://localhost/SITEFOLDER/cms/ Code: <IfModule mod_rewrite.c> Using iMac running localhost server on snow leopard latest edition. I am using localhost direct and NOT using localhost/~user/sites. But still nothing, any help would be appreciated. Thanks Si Quote:Sorry, correction if I have the <IfModule mod_rewrite.c> tag within my .htaccess file then I get a 500 internal error message, were as if these are removed then I get a 404 not found message Thanks
[eluser]johnpeace[/eluser]
Try this: Code: <IfModule mod_rewrite.c>
[eluser]simon_davies[/eluser]
Thanks for the reply johnpeace, but unfortunately this still does not work. Folder structure etc for ref: With in my root I have a folder called say SUBFOLDER within here is the CI folders applications, system and the index.php page. If i keep the htaccess page within the applications folder where it was originally, then i get the 404 Error page not found when I run the link: ....//localhost/SITENAME/SUBFOLDER/mgr/mainmenu, but if I then put the code into the root of the SUBFOLDER i get the follwoing 500 error, Internal Error - The server encountered an internal error or misconfiguration and was unable to complete your request... But if I put the index.php page name back eg:http://localhost/SITENAME/SUBFOLDER/index.php/mgr/mainmenu then it still all works fine. Thanks Si
[eluser]Unknown[/eluser]
If CI is installed in SITEFOLDER, your base url should look like this: $config['baseurl'] = "http://localhost/SITEFOLDER/"; Yours has 'cms/' at the end. The .htaccess file should be in the root of the SITEFOLDER. Be sure NOT to put a / before /index.php in the .htaccess folder or it will take you back to the root of localhost and not your SITEFOLDER. After doing all of this, autoload the URL Helper in CI and add this to each HTML to make the relative links work correctly: <base href="<?php base_url(); ?>"/> Make sure all of your links are relative to the SITEFOLDER.
[eluser]simon_davies[/eluser]
Right i have started form scratch: I downloaded CI 2.0.2, then I have placed this into a folder called NEWSITE. I run this with out modifications and all worked as you would expect and the welcome page was called. localhost/NEWSITE/index.php/welcome No sooner that i move the .htaccess page into the root from the applications folder, then add the code from CI Wiki, I get a 500 error: Code: Internal Server Error Now if I remove the <IfModule mod_rewrite.c> tags the page goes back to normal but still does not remove the index.php name. localhost/NEWSITE/index.php/welcome and errors if i use (page not found) localhost/NEWSITE/welcome any one now of a video tut that I could possibly follow to ensure that I am doing this right etc So am complexed to why this is not working... |
Welcome Guest, Not a member yet? Register Sign In |