URL Rewriting doesn't work anymore (codeigniter 2.0 official release) |
[eluser]DarKDinDoN[/eluser]
Hi ! I just downloaded the new version of this awesome framework ! (Thanks bye the way :-) ) I tried to update my application (from the old 2.0) but for some reasons the site broke ... After some tests, I figured out where the problem come from : If I do a simple installation of CI with an extra .htaccess file like this : Code: RewriteRule ^app/(.*)$ index.php/$1 [L] and these config vars : Code: $config['base_url'] = "http://example.com/"; Then accessing it Code: http://www.example.com/app/ I get a 404 error codeigniter's page. By doing this the same way with the 2.0 beta (the old one), no errors at all ... Is it normal ? PS: I tested it on a local server...
[eluser]InsiteFX[/eluser]
Code: // Will auto set it if blank now! InsiteFX
[eluser]DarKDinDoN[/eluser]
Thanks ! Actually, I noticed that it depends of the server (local or live) ... And I haven't fix my problem yet ... Two very simple examples : ________________________________________________________ 1. I copy the content of the CI 2.0 zip in the local server folder and in the web server root. I do nothing else (I mean absolutly nothing ...) and i run : Code: //For the local server -> Local server : nothing wrong. -> Live server : always display the main controller even when it must fail and call the 404 ... 2. For the second example I set the 'index_page' var to : Code: $config['index_page'] = ''; And add this '.htaccess' file to the root : Code: RewriteEngine On and i run : Code: //For the local server -> Local server : Always show the CI 404. -> Live server : always display the main controller even when it must fail and call the 404 ... ________________________________________________________ I never had these issues with the 2.0 CI DEV. So what the ... ? Did I miss something ?
[eluser]DarKDinDoN[/eluser]
Since I solved the problem (I had to activate the PHP 5.3 on OVH'server ) I try to optimize the '.htaccess' to handle multiple applications. If I have only one app in the root server : Code: SetEnv PHP_VER 5_TEST ----> activate the php 5.3 Now if I have three apps in the root server (they share the same system but note the same app folder) : index_foo.php, index_bar.php, index.php Code: SetEnv PHP_VER 5_TEST ----> activate the php 5.3 Is this all correct ? I mean, it is running fine, but I have the feeling I forgot something ...
[eluser]Spir[/eluser]
I'm on OVH as well. All my app use the same application directory but I load conf depending of URL. It works for me : Code: SetEnv PHP_VER 5_TEST On OVH you can target your URL to diferent folder. Why don't you make your different app use a different index.php but same system folder? Would be easier
[eluser]DarKDinDoN[/eluser]
Thanks Spir, since I use very different apps, I prefer separate the application folders (and I always use the same system folder for all the apps). But, using the index.php to determine wich URL matches to the requested app rather than the .htaccess is a good idee ! i'll work on it
[eluser]DarKDinDoN[/eluser]
Ok, I'm dealing with the multiple apps and only one index.php ... Here is the server's root folder : Code: ./system/ and my .htaccess to avoid the index.php : Code: RewriteEngine On And in the index.php, I manage to load the right app folder depending on the first url segment : Code: $url= $_SERVER['REQUEST_URI'] ; So, if I run : Code: http://www.example.com/ ---> should load the default app The right apps are displayed, but for the foo and bar apps, I get a CI 404 error ... did I miss something ? again ? :p
[eluser]ipsod[/eluser]
URL rewriting isn't working for me, either. I've tried several .htaccess files I found posted in the forums and wiki, and none work. I have a fresh Applications folder, and no matter what, I'm sent to the default page. No error pages, nothing, just default page, every time. It works when I add in the index.php. Just doesn't work when I'm trying to use a .htaccess rewrite. Help please!
[eluser]Vanitas[/eluser]
I think I also have problem with this. Since I created .htacces file my web page is not loading any pictures, it's strange because css styles are working. I can't access any picture even by typing direction in adress bar. @EDIT I'm using CI Reactor but it may be the same problem.
[eluser]d1a8lo24[/eluser]
Got the same problem, but I did figure out something in the 2 versions from the core and reactor. I still havent check all the files but I did find out that when replacing the system folder from reactor to the core 2.0 everything went back to normal, except for a few little glitches or I guess features that reactor suppose to offer like the ability to not use the base_url and to let reactor figure it out in the core you do have to specify it. There are 6 files that are very different from the core version and are as follow: system/core/config.php system/core/input.php system/core/lang.php system/core/loader.php and the ones that I think are causing the problem. system/core/router.php system/core/uri.php I have only check this folder and I didn't have time to really check the code and see where the problem is, if I can figure it out. But if you don't have the time just change the reactor system folder with the core system folder. https://bitbucket.org/ellislab/codeigniter |
Welcome Guest, Not a member yet? Register Sign In |