Redirecting RewriteRule
Ok I have this RewriteRule which should redirect any request for the base.css file to the {.htacces file} /include/style/base.css folder but just keeps the redirect in an infinite loop, I thought the L parameter would guarantee this will not happen.
RewriteRule (.*)/base.css$ include/style/base.css [L,NC,R=301]
Also it redirects to http: // localhost / C: /somemaps/include/style/base.css which it shouldn't do either.
Can anyone tell me how to fix this?
Also I would like to have a RewriteRule so that it will redirect any file.css file to {.htacces file} /include/style/file.css folder
BTW the .htacces file is in the root of the site (which is not the root server!)
source to share
You have redirection and messed up. A redirect is an HTTP status code that tells the browser to navigate to a different URL. You just want to overwrite the location to a different file location. Try
RewriteRule (.*)/(.*).css$ /include/style/$2.css [L,NC]
If that doesn't work, try adding the following right after turning RewriteEngine On
RewriteBase /my-virtual-folder-path-where-htaccess-is-stored
source to share