Going throw the Controller twice ! |
[eluser]Derek Jones[/eluser]
How did a missing/bad path to favicon.ico cause CI to run twice in one instantiation?
[eluser]John_Betong[/eluser]
Hi Derek, Here is the code to be placed immediately before </body></html> Code: <?php if(LOCALHOST) { ?> Here is the /root/_show_logfile.php Code: <html> and here is the /root/_delete_logfile.php Code: <html> Make an incorrecrt path to your favicon.ico and let me know the results. Needless to say you will have to setup the error logfile paths. I am curious to know if it only fails to work on my computer.
[eluser]Derek Jones[/eluser]
That's really not the question I asked, John - you need to step back, way back, to this: Quote:“Final output sent to browser”, etc was also happening twice. Instead of adding log messages to your code to trace through things, a reduction test would be more productive, as I suggested. Start with nothing, literally nothing but an echo and an empty controller and slowly add your code in until you see your application running output and such multiple times. I think you're seeing a symptom, not the problem. Edit-to-add: Clarifying why I'm making that recommendation: Others trying out your log viewer won't show productive or meaningful results if they're not experiencing the problem of double-processing to begin with.
[eluser]John_Betong[/eluser]
Hi Derek, I believe I isolated the problem to the incorrect paths to favicon.ico in the header. I ran these tests with and without the correct paths and these are the result: Here is the logfile with the incorrect path to favicon.ico with these two line in my <header> <link rel="icon" href="favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> Code: DEBUG - 2008-05-05 00:42:31 --> Config Class Initialized
[eluser]John_Betong[/eluser]
Hi Derek, I exceeded the 6,000 character limit and had to make a new post Here is the output with the correct path to favicon.ico <link rel="icon" href="/favicon.ico" type="image/x-icon" /> <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" /> Code: DEBUG - 2008-05-05 00:45:51 --> Config Class Initialized
[eluser]John_Betong[/eluser]
Hi Derek, I searched the forum and this post appears to describe in detail the problems I am having: http://ellislab.com/forums/viewthread/45802/ It is now past midnight and I am off for some much needed beauty sleep
[eluser]Derek Jones[/eluser]
Ok, I see, you're talking about separate instantiations, not the application running twice within the context of a single request. Yes, with URI segments, the browser will not form paths correctly to relatively linked assets, as the browser sees each segment as a physical directory. You can also see this with index.php written out of the URL with catch-all-esque rules like the "file and directory check" method that is so popular, where every bad request ends up being handled by the application, which can be a silly waste of resources.
[eluser]a&w[/eluser]
[quote author="Derek Jones" date="1209942874"]...Yes, with URI segments, the browser will not form paths correctly to relatively linked assets, as the browser sees each segment as a physical directory. You can also see this with index.php written out of the URL with catch-all-esque rules like the "file and directory check" method that is so popular, where every bad request ends up being handled by the application, which can be a silly waste of resources.[/quote] I experienced this same problem periodically. I noticed before finding this thread and this one: http://ellislab.com/forums/viewthread/45802/ that missing resources (jss, css, etc.) seemed to have this affect also. I was curious if you/anyone had a different .htaccess to suggest than the catch all approach. My current .htaccess looks something like this: Code: # disable directory browsing
[eluser]Derek Jones[/eluser]
You could instead only rewrite URLs with requests whose first segments match your controller names (or routing rules). See an example in the ExpressionEngine Wiki for the "include list" method. |
Welcome Guest, Not a member yet? Register Sign In |