问题描述:

Here is my problem. I have one page www.example.com which I don't want to be publicly accessible, so I want to have it behind some kind login.

The problem is that I also have www.example.com/api which I need to be publicly accessible.

Do you have any ideas how to achieve this?

Best regards,

Mladjo

网友答案:

.htaccess (or the <DIRECTORY> directive) applies to the directory you put it in (.htaccess) or the directory you specify (<DIRECTORY> directive), and all sub-directories below that one. If you have a specific file that you wish to control access on, put it in its own directory one level deeper than your web-root directory, and apply your access restriction to that path and its subdirs only.

相关阅读:
Top