LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   htaccess rule with a condition (https://www.linuxquestions.org/questions/linux-newbie-8/htaccess-rule-with-a-condition-4175487368/)

Mimouch 12-09-2013 07:48 AM

htaccess rule with a condition
 
Hi to all,
I want to make an htaccess rule that deny access to any .css or .js files if the requested url doesn't contain the word login.
Thank you.

bathory 12-09-2013 10:35 AM

Quote:

Originally Posted by Mimouch (Post 5077845)
Hi to all,
I want to make an htaccess rule that deny access to any .css or .js files if the requested url doesn't contain the word login.
Thank you.

You can try the following:
Code:

RewriteEngine On
RewriteCond %{REQUEST_URI} !(.*)login
RewriteRule (.*\.(css|js)) - [F]

Regards

Mimouch 12-17-2013 08:06 AM

Thank you.


All times are GMT -5. The time now is 06:33 AM.