Note the upgraded forum! If you are experiencing issues logging in, you may need to reset your password which should send an email. If the email doesn't arrive, be sure to check your spam folder just in case.

Migrating install - stumped!

edited January 2011 in Installation
Hopefully someone can point out the stupid thing I've missed, which for the moment has me stumped.

I've got a test running off my local MAMP install - everything is working 100% - fuel admin, controllers, views. I want to pop it onto a site so that other people can test it. Exported and created the DB on the site, amended the config/database.php to point to the new settings and uploaded everything. I can get to the home page fine - everything displays as it does locally. As soon as I try go to any other page on the site (including the /fuel/ admin area) it only shows me the home page. The home page (and all the others) are stored as pages in the database, I get the same result if I go to a "page" that is not a managed page, but a controller. I've trolled through the config settings and not seeing anything obvious. Any suggestions most welcome!

Comments

  • edited 9:42AM
    That sounds like it may be a difference in the URI_PROTOCOL used by CodeIgniter. Try the following:

    1. Got to the fuel/application/config/config.php file and change
    $config['index_page'] = 'index.php?'; // Note the question mark at the end
    2. In the same config file, right below the index_page config item, change $config['uri_protocol'] = 'QUERY_STRING';
    3. In .htaccess, change the line towards the bottom where it says
    RewriteRule .* index.php/$0 [L]
    to
    RewriteRule .* index.php?/$0 [L]

    Here is another forum thread that talks about this issue (if this is what you are experiencing)
    http://www.getfuelcms.com/forums/discussion/comment/80/#Comment_80
  • edited 9:42AM
    OK, I just grabbed the latest tarball from github and installed it clean to a new subdomain on my host, let's call it http://example.com

    Standard welcome screen (with install instructions), but when I select the link to the dashboard - http://example.com/fuel/dashboard - it simply shows the same welcome screen again.

    I made the changes that you suggested and refreshed the home page at http://example.com - the link to the dashboard is now http://example.com/index.php?/fuel

    When I follow that link it now gives the nice red and blue 404 page.

    Could it be a .htaccess thing? cpanel is creating the subdomains for me, and it might not be putting the correct AllowOverride into the vhost configuration? I guess if it wasn't working, the http://example.com/fuel/dashboard URL would give an Apache 404...
  • edited 9:42AM
    moved it out of subdomain and into main domain, same result. Most bleak :(
  • edited January 2011
    It may be an .htaccess issue. Are you sure mod_rewrite is allowed on the host? Also, did you set "admin_enabled" to TRUE in the fuel/application/config/MY_fuel.php file?
  • edited 9:42AM
    .htaccess is working fine - I just amended it to Deny From All as a test and it stopped me dead :) Reverting to the Fuel bundled .htaccess gave me back the home page.

    Changing the "admin_enabled" makes no difference.
  • edited 9:42AM
    Do you have a URL you can send me (you can email it to me if you don't want to post it here)?

    Also, are you able to get to any of these pages:
    http://example.com/index.php/fuel
    http://example.com/index.php/about
    http://example.com/index.php?/about
  • edited 9:42AM
    http://example.com/index.php/fuel works

    I've amended my config.php to use index.php as the index page, created an about page, but that at http://example.com/index.php/about gives a 404. May need to go poke the config with a stick some more.
  • edited 9:42AM
    Also, is the mod_rewrite module working with your .htaccess (it is possible to have .htaccess enabled but not have the mod_rewrite module installed). Have you used this server before with other CI projects using mod_rewrite?
  • edited 9:42AM
    I've used Wordpress on this server before, which (I assumed) was using mod_rewrite to prettify the URL's. Confirmed by amending .htaccess to be:

    Options +FollowSymLinks

    Deny From All

    Options -Indexes

    which gave me the Apache denied message :)
  • edited 9:42AM
    The forum sanitized that comment - the Deny From All was wrapped in an IfModule mod_rewrite.c
  • edited 9:42AM
    Hmm... You may want to try throwing up a basic CI 2 install with a simple controller and page (e.g. http://example.com/about) and seeing if you can get that to work with .htaccess and mod_rewrite (the .htaccess that comes with FUEL should be similar to what is normally recommended with CI):
    http://codeigniter.com/wiki/mod_rewrite/
  • edited 9:42AM
    Also, it may be helpful to know what the actual uri_protocol is being used by debugging the code in the fuel/codeigniter/core/URI.php _fetch_uri_string method and with the uri_protocol set to auto in the config.
  • edited January 2011
    I made the wrong assumption earlier that you were using the 0.91 branch so the link:
    http://example.com/index.php/about

    Would not work anyways. However this link should for the 0.9 branch:
    http://www.aseasyas.co.za/index.php/example

    Which is a static view file that comes with that branch. I'd be curious to know if are able to get a normal CI install to work on that server using mod_rewrite.

    Here are some additional links you may find useful in debugging this:
    http://stackoverflow.com/questions/1442854/codeigniter-problem-with-mod-rewrite-on-apache-1-3
    http://design.fred-lin.com/blog/view/19
  • edited 9:42AM
    thanks - I'll try a CI 2 install a bit later today to see what happens.
  • edited 9:42AM
    CI 2 gave the same error. I cycled through all possible values of $config['uri_protocol'] until 'ORIG_PATH_INFO' finally worked!

    Of course now the base href being reported by site_url() ends in a double trailing slash, and all my css and js scripts begin with a double slash, but at least the fixed routing means I can at least see what's happening on the server.

    thanks again for all the effort!
  • edited 9:42AM
    Great! Glad you figured it out.

    With regards to the double slashes, that may be due to how the $config['base_url'] and WEB_PATH are set. The WEB_PATH constant is defined in the fuel/modules/config/fuel_constants.php file.
Sign In or Register to comment.