I have a theme that uses a dynamically generated CSS file in PHP where htaccess is then used to rewrite the .css requests to .php.
The problem is that it works on my friends server but it doesn't on mine. I've asked the host if mod_rewrite is enabled and they say it is so I'm not sure what the issue is.
I can access the file when visiting it with the php extension but the .css produces nothing.
How do I debug the problem or fix it?
The htaccess file contents are as follows:
RewriteRule custom.css custom.php [L,QSA]
Solution - 1
You could try something like this:
RewriteRule ^custom\.css$ /custom.php [R=302,L]
I used the following to get the above: [[LINK href="http://stackoverflow.com/questions/1668941/how-to-use-rewriterule-to-redirect-to-a-php-file-in-the-same-folder"]]http://stackoverflow.com/questions/1668941/how-to-use-rewriterule-to-redirect-to-a-php-file-in-the-same-folder[[/LINK]]
Solution - 2
You'll need to tell the server that its css
add at the very beginning of custom.php