apache - Showing 404 error when a cookie is not set -


i think title clear; want create rule on web-server if user tries reach specific path http://mysite.com/admin face 404 error, while folder available , contains files. if cookie set on client's system, he/she can visit path.

i'm looking .htaccess solution, other answers (php or anything) appreciated too.

i'm not familiar writing rewrite rules this may help:

rewriteengine on rewritecond %{request_uri} ^/admin rewritecond %{http_cookie} !mycookie=9856012345 rewriterule .* - [l,f] 

it shows 403 error, , people know path exists, want them feel there's no such path on folder showing 404 error.

you can using 404 redirect

rewriteengine on rewritecond %{request_uri} ^/admin rewritecond %{http_cookie} !mycookie=9856012345 rewriterule .* - [l,r=404] 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -