I want password protection for the site just webservice URL stay allow all.
This expression work perfectly in apache, just need turn opposite.
<LocationMatch "^(.*service).*$">
AuthType Basic
AuthName "Restricted Files"
AuthUserFile /storage/www/xxxxx/.htpasswd
Require valid-user
</LocationMatch>
I try many many form, but doesn't work. I tried this and work perfectly in reguler tester just not in apache (2.2)
<LocationMatch "^(?!.*service).*$">
How can negate that expression?
.htaccess content if matter.
RewriteEngine on
RewriteBase /
# ....
RewriteRule txxxx/(.*) index.php?config=main_lite&r=script/xxx/deliverData&url=$1
# rule 1 -- let these requests pass through (S=1 skips the next rule)
RewriteCond %{REQUEST_FILENAME} favicon.(gif|ico) [NC,OR]
RewriteCond %{REQUEST_FILENAME} .+\.(pdf|js|css|txt|jpg|jpeg|gif|png|bmp|ico|swf|html|log|svg|ttf|eot|woff|woff2)$ [OR]
RewriteCond %{REQUEST_URI} rsc/ [OR]
RewriteCond %{REQUEST_URI} index.php$
RewriteRule (.*) - [S=1]
# rule 2 - pass every request to index.php
RewriteRule .* index.php