# Domain-wide basic auth with CakePHP 3

**URL:** <https://discourse.cakephp.org/t/domain-wide-basic-auth-with-cakephp-3/3102>\
**Category:** Need Help\
**Created:** [August 28, 2017, 6:28am UTC](https://discourse.cakephp.org/t/domain-wide-basic-auth-with-cakephp-3/3102 "2017-08-28T06:28:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ari](https://avatars.discourse-cdn.com/v4/letter/a/5f8ce5/32.png) [@ari](https://discourse.cakephp.org/u/ari)\
**Post date:** [August 28, 2017, 6:28am UTC](https://discourse.cakephp.org/t/domain-wide-basic-auth-with-cakephp-3/3102/1 "2017-08-28T06:28:15Z")

</div>

Dear All

I want additional domain wide Basic Authentication with certain freely accessible URIs (APIs from CakePHP).

I have difficulties in tuning up the .htaccess rewrite rule from CakePHP webroot. If I comment out the .htaccess rewrite, the API URI is accessible but returns file not found (as CakePHP does not “serve the URI”). If I leave the rewrite rule, the URI is not accessible without entering the authentication details.

I have asked the question in stackoverflow and I am unsure if I should copy-paste the entire info to this thread or just the [link to the question](https://stackoverflow.com/questions/45879264/cakephp-3-htaccess-apache-2-4-www-root-wide-basic-auth-with-uri-exceptions)?
