Welcome Guest, Not a member yet? Register   Sign In
404 on Live Server
#1

First, let me apologize for what must be a common question.  I couldn't find anything that directly addressed my problem.

My code works find on my local machine.  Locally, my directory structure is as follows (some extraneous files/folders not shown):

Code:
- (server)
 - [website]
   - application
     - (CodeIgniter material: models, views, controllers, etc.)
   - css
     - (CSS files here)
   - js
     - (JavaScript files here)
   - system
     - (CodeIgniter System material)
   - .htaccess

I've moved this to my online server.  Let's say it's located at mydomain.com.  I have replicated the above structure.  At public_html/mydomain, all contents of [website] from above are present.

I've made changes to two files as part of the deployment:  application/config/config.php and application/config/database.php.  Here are the changes I made to each:

Code:
// Old line from application/config/config.php

$config['base_url'] = 'http://localhost/mydomain';


// New line from application/config/config.php

$config['base_url'] = 'http://mydomain.com/';

Code:
// Old application/config/database.php

$db['default'] = array(
    'hostname' => 'localhost',
    'username' => 'root',
    'password' => '',
    'database' => '[local database name]',
    [other parameters unchanged and not shown here]
);


// New application/config/database.php

$db['default'] = array(
    'hostname' => '[server IP]',
    'username' => '[server database username]',
    'password' => '[server database password]',
    'database' => '[server database name]',
    [other parameters unchanged and not shown here]
);


I am using mod_rewrite to remove index.php from the URL.  Here is the entirety of my .htaccess file located at the root level of my website:

Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>


Again, this all works locally.  If I go to http://localhost/mydomain, everything works as intended.  However, when I go to http://mydomain.com, I get a 404 error.  If I dive in and try to grab a JavaScript file, for example http://mydomain.com/js/helper.js, I get the file I asked for.  So something is amiss in the CodeIgniter settings.

Any help is much appreciated.  I'm happy to provide more information upon request!
Reply


Messages In This Thread
404 on Live Server - by mflournoy - 02-28-2016, 02:06 PM
RE: 404 on Live Server - by kilishan - 02-28-2016, 08:36 PM
RE: 404 on Live Server - by mflournoy - 02-28-2016, 09:44 PM
RE: 404 on Live Server - by rakeshshrs - 02-29-2016, 03:26 AM
RE: 404 on Live Server - by siburny - 02-29-2016, 08:07 PM
RE: 404 on Live Server - by kilishan - 02-29-2016, 08:39 PM



Theme © iAndrew 2016 - Forum software by © MyBB