views:

31

answers:

0

I want to redirect certain filenames to a different filename for a site regardless of directory.

The idea is I have a cached, versioned filename for production, but when I am working on the file in development I want my local files without having to rename all references. For example, styles-0.1.min.css would redirect to styles.css of the same directory.

Here's what I have, but it doesn't seem to be working:

# redirect minified CSS and JavaScripts in development
ReWriteRule styles\-([\d\.]+)\.min\.css$ styles.css [L]

I've also tried.

# redirect minified CSS and JavaScripts in development
ReWriteRule ^(.*)styles\-([\d\.]+)\.min\.css$ $1styles.css [L]

Any direction would be appreciated.

EDIT

The second code set above works. The problem is actually this line:

ReWriteBase /wp

So with the URL /wp/styles-0.1.min.css my ReWriteRule is applied but the final result is /wp/wp/styles.css. It appears that the ReWriteBase is re-injecting the /wp? I've read the internal process doc - http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html#RewriteBase - but I am stumped.