Welcome Guest, Not a member yet? Register   Sign In
Debugging/Error help
#1

[eluser]rt30000[/eluser]
I am having a user that is stating they are receiving errors in an site I am building. I have enabled logging and see a few references to 404 errors. Is there a way to find which page is being requested. I am curious if this may be an .htaccess issue? I am lost when it comes to writing htaccess rules and have used one form these forums that has seemed to work great (I think it is the CI-provided one). I'm not quite sure where to start...The errors are similar to:
Quote:ERROR - 2009-05-08 10:06:01 --> 404 Page Not Found --> main/img
ERROR - 2009-05-08 10:22:08 --> 404 Page Not Found --> favicon_ico
ERROR - 2009-05-08 10:42:15 --> 404 Page Not Found --> assets
...but not every page seems tho throw the error, and they are all based off a single template view. Thoughts? Thanks
#2

[eluser]TheFuzzy0ne[/eluser]
These are essentially inbound requests to controllers that don't exist. This can be easily fixed using an htaccess file. Are you using one? If so, please post it.

Here's mine just in case you aren't using one:

Code:
# Compresses output for browsers known to support compression.
AddOutputFilterByType DEFLATE text/css text/html application/x-javascript application/javascript

# Deals with known browser quirks.
<IfModule mod_deflate.c>
        SetOutputFilter DEFLATE
        SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
        SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
        SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
        BrowserMatch ^Mozilla/4 gzip-only-text/html
        BrowserMatch ^Mozilla/4\.0[678] no-gzip
        BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</IfModule>

# Set far future header for certain file extensions to force caching.
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
        Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT"
</FilesMatch>

<IfModule mod_rewrite.c>
        RewriteEngine On
        
        # Deny access to the system directory.
        RewriteCond %{REQUEST_URI} ^/system
        RewriteRule ^(.*)$ /index.php/$1 [L]

        # If the file doesn't exist, invoke index.php
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
        #If we don't have mod_rewrite installed, all 404's
        # can be sent to index.php, and everything works as normal.
        # Submitted by: ElliotHaughin

        ErrorDocument 404 /index.php
</IfModule>
#3

[eluser]rt30000[/eluser]
Thanks for responding. Here is my .htaccess file that should remove index.php. Most of my refercnes to assets (images, css, js, etc) are root-relative. I do not fully understand .htaccess rules, this is from either the CI user guide or these forums. Thanks...let me know if anything stands out.
Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    #Removes access to the system folder by users.
    #Additionally this will allow you to create a System.php controller,
    #previously this would not have been possible.
    #'system' can be replaced if you have renamed your system folder.
    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ /index.php?/$1 [L]

    #Checks to see if the user is attempting to access a valid file,
    #such as an image or css document, if this isn't true it sends the
    #request to index.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
    # If we don't have mod_rewrite installed, all 404's
    # can be sent to index.php, and everything works as normal.
    # Submitted by: ElliotHaughin

    ErrorDocument 404 /index.php
</IfModule>
#4

[eluser]TheFuzzy0ne[/eluser]
As favicon.ico doesn't exist, it's being routed through the index.php, which explains that error. I can only assume that assets and main/img don't exist either. Creating them should solve your problem.
#5

[eluser]rt30000[/eluser]
Well, I found my link_tag() for the favicon had two slashes in it, I just replaced them with a simple link tag for now. I still cannot locate the other three error locations (assets has shown up once, main/img, and also a stylesheet that is not mine)...I am wondering if theses exist in the database. The website has a cms-side to it. Thanks fuzzy, I'll keep looking. I want to add an output that writes to the log page WHICH page is being loaded to make troubleshooting easier.
#6

[eluser]rt30000[/eluser]
UPDATE - Even though I use a master template (same root-relative link to favicon regardless of location in site), when I post a form back to itself it logs a missing favicon error. But, the page still validates and has the correct link to the favicon. Something funky going on here...?

UPDATE#2 - I switched a redirect from 'refresh' to 'location' (as this has just been moved to a linux server) and it appears the favicon issue finally disappeared. I am still having trouble finding a stylesheet link that is apparently mising - with a filename i have never create nor linked to...again, odd. :long:
#7

[eluser]rt30000[/eluser]
I have discovered the /assets issue is when a jpg is in caps (.JPG).

I still cannot figure out the references to this stylesheet. The file DID exist on their old site, a different domain. Could it be some sort of cookie or cache thing? IT ONLY APPEARS ON PAGES WITH A FORM it seems...?
Code:
ERROR - 2009-05-09 11:21:57 --&gt; 404 Page Not Found --&gt; cottages/LakeSideStyleSheet_css
If you view the source code there is no reference to this stylesheet, and I use a global template anyhow. I have searched over and over but cannot seem to figure this out. Any thoughts?
#8

[eluser]TheFuzzy0ne[/eluser]
Is there any chance of a link to your site? Then I can have a look for you.




Theme © iAndrew 2016 - Forum software by © MyBB