how to remove index.php in my URL |
[eluser]ppeemm[/eluser]
Hi there, I have tried a lot of different things to solve this issue but I didn't find the good one. here is my web site structure: Code: index.php I have just split off CI's files from my web site to make it easier if I have to make it evolve. (not sure it is a good way to do that?!) in my config file, I have got this : Code: /* and in my .htaccess I have just copied and pasted this Code: RewriteEngine on from here : http://www.ellislab.com/codeigniter/user.../urls.html I have seen in another topic that I may remove the Code: '/' Code: RewriteRule ^(.*)$ /index.php/$1 [L] so I also tried with Code: RewriteRule ^(.*)$ index.php/$1 [L] but my web site still doesn't work. can you help me? by the way, I am trying on me dev server but it was working on my computer. thanks in advance
[eluser]sparkling tux[/eluser]
Hi! It is true, that leading slash shouldn't be there, so it's good that you removed it. If you'd provide some more data of what exactly doesn't work it'll be easier to help. However, this could possibly resolve your problem (as I'm using it, and it works for me): replace the rewrite condition, provided in the example in the CI docs with these: Code: RewriteCond %{REQUEST_FILENAME} !-f
[eluser]ppeemm[/eluser]
thanks! unfortunatly I have tried with your code ie my .htaccess was: Code: RewriteEngine on I don't even know how I can explain you better. just, when i try this URL : http://myurl.com/index.php/MainMenu/adminView is works but that one : http://myurl.com/MainMenu/adminView doesn't
[eluser]sparkling tux[/eluser]
Seems as if the problem lies somewhere else. Try to describe how does exactly the page behaves itself, when you're trying to enter it without index.php inthe URL. Also recheck config and paths carefully (as you said it doesn't work on the dev server) - I once forgot to change the database settings.
[eluser]moonbeetle[/eluser]
http://ellislab.com/forums/viewthread/47023/ Elliot Haughin's solution (.htaccess file in the directory of the project) worked for me, it might work for you as well: Quote:<IfModule mod_rewrite.c>
[eluser]ppeemm[/eluser]
[quote author="sparkling tux" date="1188406390"]Seems as if the problem lies somewhere else. Try to describe how does exactly the page behaves itself, when you're trying to enter it without index.php inthe URL. Also recheck config and paths carefully (as you said it doesn't work on the dev server) - I once forgot to change the database settings.[/quote] well I have the problem on my whole web site (even if it is only few pages !!!) when I try without the index.php in the URL, I have got this message : Code: Not Found By the way, it is not a pb with my DB. joris, I have already seen this thread and tried this solution but it doesn't work either/ any ideas? thanks again guys
[eluser]sparkling tux[/eluser]
It's just a guess, but it may mean that Rewriting isn't working - try to test some terribly simple rule, say everything goes to index.html. And also I may suggest to try your URL *lowercase* (but for some reason I think it won't help).
[eluser]cloud226[/eluser]
that could possible be you havent enabled the mod_rewrite function from apache server yet http://codeignitercamp.blogspot.com/2007...write.html as a hint
[eluser]ppeemm[/eluser]
[quote author="cloud226" date="1188466867"]that could possible be you havent enabled the mod_rewrite function from apache server yet http://codeignitercamp.blogspot.com/2007...write.html as a hint[/quote] no I am afraid, the issue doesn't come from here either...
[eluser]ppeemm[/eluser]
could you tell me how can I test my .htaccess file just to know if it works? I have only this in it Code: ErrorDocument 404 /error.html Code: <body> Code: 404 is it me or what? |
Welcome Guest, Not a member yet? Register Sign In |