Page 1 of 1

How to make the server accept these .htaccess lines?

PostPosted: 15. March 2013 05:06
by FrankC
.
I would like to keep my local files in sync with my remote files, including the .htaccess. But it I put
Code: Select all
ExpiresActive On
ExpiresDefault "modification"
in it, I get a 500 internal local server error, while on the remote server there is no problem.

The RewriteEngine lines do not give any error. How can I make the local server accept the Expires line as well?

Re: How to make the server accept these .htaccess lines?

PostPosted: 15. March 2013 05:34
by Altrea
Does your Apache error.log file contain any message about this error?

Re: How to make the server accept these .htaccess lines?

PostPosted: 15. March 2013 08:15
by FrankC
Thanks for the speedy reply! :D

It does:

Code: Select all
[Fri Mar 15 04:52:47 2013] [alert] [client 127.0.0.1] C:/xampp/htdocs/Websites/TSE/.htaccess: Invalid command 'ExpiresActive', perhaps misspelled or defined by a module not included in the server configuration.


But I don't know what to do with that, because .htaccess in itself is accepted -- the RewriteEngine lines prove that. And it is not misspelled either, see httpd.apache.org/docs/2.2/mod/mod_expires.html.

Re: How to make the server accept these .htaccess lines?

PostPosted: 15. March 2013 11:08
by Altrea
Is mod_expires included and activated in your Apache httpd.conf?
By default it is commented out.

Re: How to make the server accept these .htaccess lines?

PostPosted: 15. March 2013 12:52
by FrankC
That did the trick. Not at first, but after restarting Apache it worked perfectly. Thanks!

Just one question: why is that commented out by default? Isn't caching until modified very important for a speedy site rendering, and isn't through .htaccess the only way to accomplish that?

Re: How to make the server accept these .htaccess lines?

PostPosted: 15. March 2013 13:02
by Altrea
XAMPP is a local testing and development environment. Speed by caching is not the primary focus i think.
And it can be very confusing (and increasing the support amound here) to beginners having issues of old cached data.

but the real reason is: XAMPP is based on the Apache binaries of ApacheLounge and there is and was no need to activate the module because most users don't miss it (and if, they can easily activate it).