Forum Moderators: phranque

Message Too Old, No Replies

.htaccess removes "<?php include?>" from pages?

         

prototism

6:02 am on Sep 20, 2006 (gmt 0)

10+ Year Member



below is the contents of my .htaccess file. while it does do its job in regards to the custom 404 page, it seems to remove the php includes from the source of that page, and that page only. this is a problem, because i use php includes to include references to my external stylesheets, call javascripts, and so on.

ErrorDocument 404 /backend/error/404.php

<snip>

When you navigate to the actual 404.php file itself at http://example.com/backend/error/404.php, the same effect [no php include] is produced.

am i missing something from my .htaccess?

[edited by: jatar_k at 6:03 am (utc) on Sep. 20, 2006]

[edited by: jdMorgan at 12:54 pm (utc) on Sep. 20, 2006]
[edit reason] Examplified. No URLs, please. See TOS. [/edit]

jdMorgan

12:59 pm on Sep 20, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The cause is likely the same as that cited in this thread: [webmasterworld.com...]

I suggest that you use canonical links in all errordocuments. Furthermore, minimize the dependencies on these pages. Errordocuments for 403 and 500 errors should have no external dependencies whatsoever, i.e. no images, no external stylesheets, no external JavaScripts. Otherwise, you may encounter failures where the error page itself falis, and this will lead to an 'infinite' loop, both compounding the original root problem and hiding its symptoms.

Jim