I have multiple css files in a directory (style0.css, style1.css etc..) How can I redirect a request to these css files with htaccess so that a php can process the requested css file.
ex. /styles/style0.css -> /includes/compressor.php?i=style0.css ?
I have multiple css files in a directory (style0.css, style1.css etc..) How can I
Share
These .htAccess command activate the RewriteEngine. This will let you analyse the request URL and execute the one you want into the server. The second line take all URL that end with .css and will take the file name to insert it as a parameter (like you wanted in your example).
For example:
http://localhost/styles/style1.css will go to
http://localhost/includes/compressor.php?i=style1.css
The L flag will tell Apache to stop processing the rewrite rules for that request.