ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

code igniter on knownhost?

December 30, 2011 11:45am

Subscribe [2]
  • #1 / Dec 30, 2011 11:45am

    back2basics

    4 posts

    I just bought my first VPS and installed code igniter on Knownhost. I had been working on my site in a MAMP instance and uploaded the entire thing to my public_html folder. Currently I’m getting the issue listed in the installation troubleshooting guide here: http://ellislab.com/codeigniter/user-guide/installation/troubleshooting.html where all my URLs go to the default index. I’m able to change the welcome_message.php stuff to make it display what I want in general, but as the troubleshoot doc says all my URLs go to the index default. I tried all the solutions listed in the troubleshoot and have contacted my VPS support, but no dice as of yet. Has anyone run into this problem before? Are there any other solutions I should try?

    Cheers,
    b2b

  • #2 / Dec 30, 2011 1:53pm

    CroNiX

    4713 posts

    I’m not following.  All urls go to index.php as that is how CI works.  You can’t get away from that.  What most people do, though, is remove “index.php” so it doesn’t show up in the url (but CI still uses it!)

    So instead of:
    http://www.yoursite.com/index.php/welcome
    The url would be:
    http://www.yoursite.com/welcome

    Is that what you are trying to do?

  • #3 / Dec 30, 2011 3:03pm

    back2basics

    4 posts

    Sorry, I probably wasn’t being specific enough.

    No matter what URL I give it, it hits the welcome.php controller and welcome_message.php view. That is I can give it http://www.mysite.com or www.mysite.com/index.php or http://www.mysite.com/index.php/mycontroller. All three of those will give me back the welcome message from CodeIgniter. I thought it might be something weird in my code, so I tried making a new controller WelcomeTest.php that is identical to welcome.php except it echoes a little message to indicate it got to the other controller before accessing the view. When I try to access that via http://www.mysite.com/index.php/WelcomeTest, I still get the original welcome.php controller.

    It seems to be exactly what the troubleshooting thing in the user guide is referring to, but none of their fixes seem to work.

    Cheers,
    b2b

  • #4 / Dec 30, 2011 3:21pm

    CroNiX

    4713 posts

    If you remove index.php via htaccess, which it seems you have, then you are correct that all 3 of those will route to the same thing.  That shouldn’t matter unless you are creating actual links to them.  Pick one and use only that one in links.

    If there isn’t an actual link to http://yoursite.com/index.php/mycontroller, then no one will ever know to go there and google won’t catalog it.

    Just like if you go to
    http://www.yoursite.com/index.php
    and
    http://www.yoursite.com
    you will get the same thing, on any site that uses php…CI or not.

    All the htaccess does is make it so that the url does not HAVE to contain index.php, but it will still work with it.  But again, if you never include the ‘index.php’ portion in a link no one will know and google won’t penalize you for duplicate content.

  • #5 / Dec 30, 2011 3:36pm

    back2basics

    4 posts

    I haven’t removed my index.php via htaccess though. I don’t even have a .htaccess file uploaded to my directory.

    Actually, I should clarify in case it matters, I HAD removed my index.php via a .htaccess file, but when thing weren’t working upon upload to the VPS I blew everything away to start from scratch. So in order to do that I removed all my files and uploaded a fresh copy of Code Igniter. Then I went through the exercise of making a new test controller, setting the config and seeing if I could get that to work.

    Cheers,
    L

  • #6 / Dec 30, 2011 3:41pm

    CroNiX

    4713 posts

    ok.  The point is to only use one in links.

    http://www.mysite.com
    http://www.mysite.com/index.php
    http://www.mysite.com/index.php/mycontroller

    If this is your homepage, you would only use the first one in links and never the other 2.

  • #7 / Dec 30, 2011 3:47pm

    back2basics

    4 posts

    Okay, perhaps I’m an idiot? I finally got it to work (on a typo). So it looks like it’s case sensitive? Since when are URLs case sensitive? That never happened on my local set-up. Is that a setting somewhere?

  • #8 / Dec 31, 2011 11:28am

    Waqas

    3 posts

    Files/folder names on Linux are case sensitive - your local maching probably has an OS (like Windows) that is not case sensitive to filenames/folders to it worked ok on your local server

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases