News for hackers. Stuff that matters.
Re:Top Useful .htaccess rewrites, Mod_Rewrite Tricks and Tips by timmyc on Tuesday April 13, 2010 @11:59AM (#1262385)
Seems like a copy of http://www.askapache.com/htaccess/mod_rewrite-tips-and-trick...

but with no attrition.

Re:Top Useful .htaccess rewrites, Mod_Rewrite Tricks and Tips by DanHulton on Tuesday April 13, 2010 @12:56PM (#1262580)
Attribution.

In fact, being that it doesn't have the attribution, I'd say it did suffer from attrition.

But that's enough of me bein' a grammar nerd.

Re:Top Useful .htaccess rewrites, Mod_Rewrite Tricks and Tips by timmyc on Tuesday April 13, 2010 @06:21PM (#1263528)
thanks, had a typo and it got corrected to that
Re:Top Useful .htaccess rewrites, Mod_Rewrite Tricks and Tips by billybob on Tuesday April 13, 2010 @11:53AM (#1262362)
"This rewrites all files for /zap/j/anything-anynumber.js to /zap/j/anything.js and /zap/c/anything-anynumber.css to /zap/c/anything.css"

Why post a file called "foo-12930.css" and show it to browsers at "foo.css"? The opposite is better - keep updating foo.css (and use version control), but show it to users as "foo.css?some-timestamp". This is what Rails does. If your server is configured to tell browsers to cache CSS files for a year, they will request the file once, then continue to use the cached version until you update the file. Then they'll see that it has a new timestamp and get the new version.

This post (and the previous one) show how to do this in PHP: http://sleeplessgeek.blogspot.com/2010/03/cache-busting-in-p...

Re:Top Useful .htaccess rewrites, Mod_Rewrite Tricks and Tips by thezilch on Tuesday April 13, 2010 @12:05PM (#1262401)
The opposite is happening here. The user (browser) requests "foo-123.css" and is served "foo.css."
Re:Top Useful .htaccess rewrites, Mod_Rewrite Tricks and Tips by jeremyw on Tuesday April 13, 2010 @11:58AM (#1262382)
Note you can make the www redirect generic across virtual hosts. (And, R=301 or not depending on the circumstance.)

    # non-www -> www"
    RewriteCond %{HTTP_HOST} !^www\."
    RewriteRule .            http://www.%{SERVER_NAME}%{REQUEST_URI} [R,L]"