Welcome Guest, Not a member yet? Register   Sign In
404 URL Not Found issues...
#1

[eluser]ocergyNohtna[/eluser]
so I can't get any of my external files to load... i.e. css, js, images, etc... here's my folder structure:

/htdocs => root (CI's index.php is in here)
/htdocs/commonFrameworks => path for CI (system folder is in here)
/htdocs/mysitesdontexist => site's base path (CI's application folder is in here as well as my .htaccess file)
/htdocs/mysitesdontexist/js => js files
/htdocs/mysitesdontexist/css => css files
/htdocs/mysitesdontexist/images => image files

now for the contents of files:

.htaccess

Code:
RewriteEngine on

RewriteCond $1 !^(index\.php|logs|images|robots\.txt|favicon.ico|css|js)

RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php/$1 [L]

index.php

Code:
<?php

/*
|---------------------------------------------------------------
| PHP ERROR REPORTING LEVEL
|---------------------------------------------------------------
|
| By default CI runs with error reporting set to ALL.  For security
| reasons you are encouraged to change this when your site goes live.
| For more info visit:  http://www.php.net/error_reporting
|
*/
    error_reporting(E_ALL);

/*
|---------------------------------------------------------------
| SYSTEM FOLDER NAME
|---------------------------------------------------------------
|
| This variable must contain the name of your "system" folder.
| Include the path if the folder is not in the same  directory
| as this file.
|
| NO TRAILING SLASH!
|
*/
    $system_folder = "commonFrameworks/php/ci/1.7.0/system";

/*
|---------------------------------------------------------------
| APPLICATION FOLDER NAME
|---------------------------------------------------------------
|
| If you want this front controller to use a different "application"
| folder then the default one you can set its name here. The folder
| can also be renamed or relocated anywhere on your server.
| For more info please see the user guide:
| http://ellislab.com/codeigniter/user-guide/general/managing_apps.html
|
|
| NO TRAILING SLASH!
|
*/
    $application_folder = "mysitesdontexist/application";

/*
|===============================================================
| END OF USER CONFIGURABLE SETTINGS
|===============================================================
*/


/*
|---------------------------------------------------------------
| SET THE SERVER PATH
|---------------------------------------------------------------
|
| Let's attempt to determine the full-server path to the "system"
| folder in order to reduce the possibility of path problems.
| Note: We only attempt this if the user hasn't specified a
| full server path.
|
*/
if (strpos($system_folder, '/') === FALSE)
{
    if (function_exists('realpath') AND @realpath(dirname(__FILE__)) !== FALSE)
    {
        $system_folder = realpath(dirname(__FILE__)).'/'.$system_folder;
    }
}
else
{
    // Swap directory separators to Unix style for consistency
    $system_folder = str_replace("\\", "/", $system_folder);
}

/*
|---------------------------------------------------------------
| DEFINE APPLICATION CONSTANTS
|---------------------------------------------------------------
|
| EXT        - The file extension.  Typically ".php"
| FCPATH    - The full server path to THIS file
| SELF        - The name of THIS file (typically "index.php")
| BASEPATH    - The full server path to the "system" folder
| APPPATH    - The full server path to the "application" folder
|
*/
define('EXT', '.'.pathinfo(__FILE__, PATHINFO_EXTENSION));
define('FCPATH', __FILE__);
define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
define('BASEPATH', $system_folder.'/');

if (is_dir($application_folder))
{
    define('APPPATH', $application_folder.'/');
}
else
{
    if ($application_folder == '')
    {
        $application_folder = 'application';
    }

    define('APPPATH', BASEPATH.$application_folder.'/');
}

/*
|---------------------------------------------------------------
| LOAD THE FRONT CONTROLLER
|---------------------------------------------------------------
|
| And away we go...
|
*/
require_once BASEPATH.'codeigniter/CodeIgniter'.EXT;

and I'm running MAMP on OS X. running apache 2.0.59. php 5.2.6. mysql 5.0.41. and if you'd like to see phpinfo() you can view it here: http://mysites.dontexist.org/info.php

navigating to the root of the site, CI loads fine, but my images and css don't load. i just get 404 errors. and navigating directly to an image or css file i get the URL Not Found 404 error page.

i feel like this has something to do with CI in general, or the fact that i have the system folder in a different location as normal. i've also set up a test to see if it was .htaccess (and while it still may be, i don't think it is, but by all means, correct me if i'm wrong... %-P) this is what the test looks like.

folder structure:

/htdocs => root
/htdocs/test => this is where .htaccess is, and it's identical to the one above
/htdocs/images => an image is in here (sepiame.jpg)

if i navigate to /images/sepiame.jpg it loads fine.

i have a dyndns account that i'm using to let you all take a look at it it's here: http://mysites.dontexist.org/ which pulls from the /mysitesdontexist folder and http://mysites.dontexist.org/test/ pulls from the /test folder.

any assistance is greatly appreciated. if i've left anything out that would be helpful in helping troubleshoot please ask and i'll reply with any info you may need.
#2

[eluser]meigwilym[/eluser]
Try this .htaccess file for size

http://codeigniter.com/wiki/mod_rewrite/

Mei
#3

[eluser]ocergyNohtna[/eluser]
no difference. it's pretty much the same that i'm already doing... thanks for the reply though. Tongue
#4

[eluser]ocergyNohtna[/eluser]
so i couldn't find out why this wouldn't work so i took the folder structure back to normal and everything is fine...if anyone can tell me what i'm missing about the setup described i'd love to hear about it. i really would like to have a "common" folder that i utilize multiple sites from...can't figure out where i went wrong. i'm sure i'll tackle it again and prolly have no issues and then wonder what i was smoking today that i couldn't get this to work....




Theme © iAndrew 2016 - Forum software by © MyBB