0

I'm working on a site locally within a folder with WAMP. When I add the following to my .htaccess file the folder is no longer viewable in WAMP.

ExpiresActive On

ExpiresDefault "access"

I'm working on a cache manifest demo and the code is to prevent files being cached, I've no idea why it would make the folder disappear.

2 Answers 2

2

I suspect a different approach will work better (I haven't actually tested this though:-). Try in your .htaccess something like

ExpiresActive Off

Header set Cache-Control "no-cache, proxy-revalidate, no-transform"

Header set Pragma "no-cache"

(No blank lines needed in .htaccess, but if I leave them out here "line wrap" thinks it's just a funky paragraph and runs everything together.)

What you've got now specifies that the pages ARE cacheable, but the cache time is 0, so all pages are always out of date. This arguably doesn't make a whole lot of sense, and who knows which piece of software is doing some "error recovery" that results in the directory not being visible. I suspect something is stuck in a loop requesting the same page over and over trying to get a copy that isn't already expired, and the failsafe for too many loops goes off and the browser just throws up its hands and makes the whole folder invisible.

It's sometimes true that "xxx but 0" is the same as "no-xxx" ...but not in this case. Saying to an Apache server "cacheable but 0" is NOT quite the same as saying "not cacheable" ...close but not the same, and possibly handled weirdly by some software.

1
  • Welcome to Pro Webmasters, Chuck. If you want to display preformatted source code, simply put an empty line before the code, and then indent each line of code with either at least 1 tab or 4 or more spaces. A quick way to do this is to just highlight the code and then hit Ctrl+K. Feb 22, 2013 at 13:22
1

Actually I think it is something different. When I tried to load a site with ExpiresActive On in the .htaccess file my site also does not load. In the apache error.log it says the following:

Invalid command 'ExpiresActive', perhaps misspelled or defined by a module not included in the server configuration

After enabling Expires Module through WAMP system tray it works!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.