Forum Moderators: phranque

Message Too Old, No Replies

redirecting to static page or generating again if not found

last modified date gets lost in the wash?

         

jamie

6:38 am on Jan 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



hi,

trying to reduce server load on our site, i am experimenting with generating static html pages from a php script. my mod_rewrite looks like this and appears to work well:

RewriteCond %{REQUEST_FILENAME}!-s
RewriteCond %{REQUEST_FILENAME}/index.html!-s
RewriteCond %{REQUEST_URI}!^/static_html/
RewriteRule ^(.*)$ /static_html/$1 [L]
RewriteCond %{REQUEST_FILENAME}!-s
RewriteCond %{REQUEST_FILENAME}/index.html!-s
RewriteRule ^(.*)$ html.php/$1 [PT,L]

if a request for a static page is not met, the html.php script runs and generates it for the next time.

the problem is some of my server headers get lost in the process. namely the Last Modified date which i sent manually via the php script.

i assumed apache would send the last modified date automaticallybecause it is accessing a normal static html page, but this is not the case?

any clues?

many thanks!

jamie

6:58 am on Jan 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



!

i realised why...

my server is set to parse all html pages as php, which is why headers are no longer sent.

hmmm....

so i turn off addhandler for that directory or include a bit of php code in the generated pages to send the correct headers..

ok cheers anyway

jamie

8:05 am on Jan 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



back again... ;-)

can't for the life of me find out how to disable the AddHandler directive for a subdirectory.

in my /doc_root i have:

AddHandler application/x-httpd-php .htm .html

i am generating static pages in /doc_root/static_html/

so i need a way to not parse the html pages as php in this subdirectory.

i have tried a
<directory>
allowoveride none

but this doesn't work. i have tried duplicating the addhandler line wihtout the .htm .html, but this doesn't work either...?

much appreciate the help

jdMorgan

9:36 am on Jan 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



jamie,

See mod_mime [httpd.apache.org], and the RemoveHandler directive.

Jim

jamie

10:35 am on Jan 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



thank you Jim!