Is it possible to protect a single URL through .htaccess
? For example I will have website.com/index.php?skin=name
. Can I password protect only this url? (with no PHP changes, only .htaccess
)
website.com/index.php
or website.com/index.php?skin=other_name
should not be restricted.
You can if you use mod-rewrite to rewrite the address to something else and protect that.
https://serverfault.com/questions/94964/apache-locationmatch-directive
You can't use LocationMatch, even though it would appear that you could.
Your best bet is to do it in PHP. A quick google search later and I found a great way to use PHP_AUTH which looks a lot like the .HTACCESS login prompt
Source: http://snippets.dzone.com/posts/show/2006
You can rewrite the address to protect it like this: