You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Jonathan Hayward http://JonathansCorner.com" <ch...@gmail.com> on 2007/10/19 22:53:03 UTC
[users@httpd] .htaccess/Expires/Cache-Control: 500 error
I am getting an internal server error (500) if I place the following in my
ROOT .htaccess:
<FilesMatch "\\.(ico|pdf|flv|jpg|jpeg|png|gif|css|swf)$">
Header set Expires "Sun, 18 Nov 2007 14:35:41 GMT"
Header set Cache-Control "max-age: 2764800; public"
</FilesMatch>
<FilesMatch "\\.(html)$">
Header set Expires "Sat, 20 Oct 2007 15:35:41 GMT"
Header set Cache-Control "max-age: 86400; public"
</FilesMatch>
<FilesMatch "/$">
Header set Expires "Sat, 20 Oct 2007 15:35:41 GMT"
Header set Cache-Control "max-age: 86400; public"
</FilesMatch>
<FilesMatch "\\.(js)$">
Header set Expires "Fri, 26 Oct 2007 15:35:41 GMT"
Header set Cache-Control "max-age: 604800; public"
</FilesMatch>
The error also occurs with the following, or if I replace the date with the
output of a Linux /bin/date after incrementing the hour by two.
<FilesMatch "\\.(ico|pdf|flv|jpg|jpeg|png|gif|css|swf)$">
Header set Expires "Sun, 18 Nov 2007 14:35:41 GMT"
</FilesMatch>
What is wrong with the longer and/or shorter files to be getting an internal
server error?
--
++ Jonathan Hayward, jonathan.hayward@pobox.com
** To see an award-winning website with stories, essays, artwork,
** games, and a four-dimensional maze, why not visit my home page?
** All of this is waiting for you at http://JonathansCorner.com
Re: [users@httpd] .htaccess/Expires/Cache-Control: 500 error
Posted by "Jonathan Hayward http://JonathansCorner.com" <ch...@gmail.com>.
Thanks.
On 10/22/07, Joshua Slive <jo...@slive.ca> wrote:
>
> On 10/22/07, Jonathan Hayward http://JonathansCorner.com
> <ch...@gmail.com> wrote:
> > Sorry for not replying earlier...
> >
> > Is Header version-specific? The error message in the log is "...Invalid
> > command 'Header,' perhaps misspelled or defined by a module not included
> in
> > the server configuration".
>
> Right. So the whole regex/date thing was a wild goose chase. Always
> start by checking the error_log.
>
> >
> > What module(s) need to be installed? The server is an Apache 2 under
> Linux;
> > if more version information is helpful, what do I run to get the
> version?
>
> You need the module mod_headers, which is included in every apache
> version but is obviously not loaded in your version. Check your
> LoadModule directives.
>
> Joshua.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
--
++ Jonathan Hayward, jonathan.hayward@pobox.com
** To see an award-winning website with stories, essays, artwork,
** games, and a four-dimensional maze, why not visit my home page?
** All of this is waiting for you at http://JonathansCorner.com
Re: [users@httpd] .htaccess/Expires/Cache-Control: 500 error
Posted by "Jonathan Hayward http://JonathansCorner.com" <ch...@gmail.com>.
Just adding a follow-up note to say that it seems to be working as intended
with the module installed.
Thank you,
On 10/22/07, Joshua Slive <jo...@slive.ca> wrote:
>
> On 10/22/07, Jonathan Hayward http://JonathansCorner.com
> <ch...@gmail.com> wrote:
> > Sorry for not replying earlier...
> >
> > Is Header version-specific? The error message in the log is "...Invalid
> > command 'Header,' perhaps misspelled or defined by a module not included
> in
> > the server configuration".
>
> Right. So the whole regex/date thing was a wild goose chase. Always
> start by checking the error_log.
>
> >
> > What module(s) need to be installed? The server is an Apache 2 under
> Linux;
> > if more version information is helpful, what do I run to get the
> version?
>
> You need the module mod_headers, which is included in every apache
> version but is obviously not loaded in your version. Check your
> LoadModule directives.
>
> Joshua.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
--
++ Jonathan Hayward, jonathan.hayward@pobox.com
** To see an award-winning website with stories, essays, artwork,
** games, and a four-dimensional maze, why not visit my home page?
** All of this is waiting for you at http://JonathansCorner.com
Re: [users@httpd] .htaccess/Expires/Cache-Control: 500 error
Posted by Joshua Slive <jo...@slive.ca>.
On 10/22/07, Jonathan Hayward http://JonathansCorner.com
<ch...@gmail.com> wrote:
> Sorry for not replying earlier...
>
> Is Header version-specific? The error message in the log is "...Invalid
> command 'Header,' perhaps misspelled or defined by a module not included in
> the server configuration".
Right. So the whole regex/date thing was a wild goose chase. Always
start by checking the error_log.
>
> What module(s) need to be installed? The server is an Apache 2 under Linux;
> if more version information is helpful, what do I run to get the version?
You need the module mod_headers, which is included in every apache
version but is obviously not loaded in your version. Check your
LoadModule directives.
Joshua.
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] .htaccess/Expires/Cache-Control: 500 error
Posted by "Jonathan Hayward http://JonathansCorner.com" <ch...@gmail.com>.
Sorry for not replying earlier...
Is Header version-specific? The error message in the log is "...Invalid
command 'Header,' perhaps misspelled or defined by a module not included in
the server configuration".
What module(s) need to be installed? The server is an Apache 2 under Linux;
if more version information is helpful, what do I run to get the version?
On 10/20/07, Joshua Slive <jo...@slive.ca> wrote:
>
> On 10/20/07, Jonathan Hayward http://JonathansCorner.com
> <ch...@gmail.com> wrote:
> > Just for sanity's sake--could you check that the date is appropriately
> > formatted, and if the date format is causing problems, give an
> appropriate
> > format for "Mon, 1 Jan 2007 1:00:00 GMT" or "Mon, 01 Jan 2007 01:00:00
> > GMT"?
>
> The Header directive doesn't care about the date format. It just
> treats it as a string and shoves it in the header.
>
> You didn't answer my question about what's in the error_log.
>
> Joshua.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
--
++ Jonathan Hayward, jonathan.hayward@pobox.com
** To see an award-winning website with stories, essays, artwork,
** games, and a four-dimensional maze, why not visit my home page?
** All of this is waiting for you at http://JonathansCorner.com
Re: [users@httpd] .htaccess/Expires/Cache-Control: 500 error
Posted by Joshua Slive <jo...@slive.ca>.
On 10/20/07, Jonathan Hayward http://JonathansCorner.com
<ch...@gmail.com> wrote:
> Just for sanity's sake--could you check that the date is appropriately
> formatted, and if the date format is causing problems, give an appropriate
> format for "Mon, 1 Jan 2007 1:00:00 GMT" or "Mon, 01 Jan 2007 01:00:00
> GMT"?
The Header directive doesn't care about the date format. It just
treats it as a string and shoves it in the header.
You didn't answer my question about what's in the error_log.
Joshua.
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] .htaccess/Expires/Cache-Control: 500 error
Posted by "Jonathan Hayward http://JonathansCorner.com" <ch...@gmail.com>.
Just for sanity's sake--could you check that the date is appropriately
formatted, and if the date format is causing problems, give an appropriate
format for "Mon, 1 Jan 2007 1:00:00 GMT" or "Mon, 01 Jan 2007 01:00:00
GMT"?
On 10/20/07, Jonathan Hayward http://JonathansCorner.com <
christos.jonathan.hayward@gmail.com> wrote:
>
> The documentation I had seen -- http://www.askapache.com/htaccess/apache-speed-expires.html
> , http://www.askapache.com/htaccess/apache-speed-cache-control.html , gave
> a double backslash, and my experimenting with a single backslash didn't
> work.
>
> The following (with a single backslash) is enough to give an internal
> server error:
>
> <FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|css|swf)$">
> Header set Expires "Sun, 18 Nov 2007 14:35:41 GMT"
> </FilesMatch>
>
> On 10/20/07, Joshua Slive <jo...@slive.ca> wrote:
> >
> > On 10/19/07, Jonathan Hayward http://JonathansCorner.com
> > <ch...@gmail.com> wrote:
> > > I am getting an internal server error (500) if I place the following
> > in my
> > > ROOT .htaccess:
> >
> > What does the apache error log say?
> >
> > I'm not sure why you are using a double-slash at the beginning of the
> > regexes. It seems you only want a single.
> >
> > Joshua.
> >
> > ---------------------------------------------------------------------
> > The official User-To-User support forum of the Apache HTTP Server
> > Project.
> > See <URL:http://httpd.apache.org/userslist.html> for more info.
> > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> > " from the digest: users-digest-unsubscribe@httpd.apache.org
> > For additional commands, e-mail: users-help@httpd.apache.org
> >
> >
>
>
> --
> ++ Jonathan Hayward, jonathan.hayward@pobox.com
> ** To see an award-winning website with stories, essays, artwork,
> ** games, and a four-dimensional maze, why not visit my home page?
> ** All of this is waiting for you at http://JonathansCorner.com
>
--
++ Jonathan Hayward, jonathan.hayward@pobox.com
** To see an award-winning website with stories, essays, artwork,
** games, and a four-dimensional maze, why not visit my home page?
** All of this is waiting for you at http://JonathansCorner.com
Re: [users@httpd] .htaccess/Expires/Cache-Control: 500 error
Posted by "Jonathan Hayward http://JonathansCorner.com" <ch...@gmail.com>.
The documentation I had seen --
http://www.askapache.com/htaccess/apache-speed-expires.html ,
http://www.askapache.com/htaccess/apache-speed-cache-control.html , gave a
double backslash, and my experimenting with a single backslash didn't work.
The following (with a single backslash) is enough to give an internal server
error:
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|css|swf)$">
Header set Expires "Sun, 18 Nov 2007 14:35:41 GMT"
</FilesMatch>
On 10/20/07, Joshua Slive <jo...@slive.ca> wrote:
>
> On 10/19/07, Jonathan Hayward http://JonathansCorner.com
> <ch...@gmail.com> wrote:
> > I am getting an internal server error (500) if I place the following in
> my
> > ROOT .htaccess:
>
> What does the apache error log say?
>
> I'm not sure why you are using a double-slash at the beginning of the
> regexes. It seems you only want a single.
>
> Joshua.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> " from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>
--
++ Jonathan Hayward, jonathan.hayward@pobox.com
** To see an award-winning website with stories, essays, artwork,
** games, and a four-dimensional maze, why not visit my home page?
** All of this is waiting for you at http://JonathansCorner.com
Re: [users@httpd] .htaccess/Expires/Cache-Control: 500 error
Posted by Joshua Slive <jo...@slive.ca>.
On 10/19/07, Jonathan Hayward http://JonathansCorner.com
<ch...@gmail.com> wrote:
> I am getting an internal server error (500) if I place the following in my
> ROOT .htaccess:
What does the apache error log say?
I'm not sure why you are using a double-slash at the beginning of the
regexes. It seems you only want a single.
Joshua.
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org