Search code examples
restzend-framework2cpanellaminas-api-tools

403 for Apigility and Cpanel


For some reason, I'm getting a weird 403 issues when I use ZF2 + apigility + Cpanel. I do not know where to look!

I have the same code running on my local machine and an aws server. Both do not have the 403 issues when trying to authenticate using Oauth2.

But, once I moved my code to my client's machine that is running on Cpanel. I have been getting this 403 issue. Initially, I thought it might be a permission issue, but that is not it. The only thing that is different is probably server.

So, I'm guess the problem would be related to security settings.

Please advice what are the possible security settings that might be causing this problem...


Solution

  • If you have managed an error log, start by checking it in order to know exactly why you're getting that 403 issue.

    I thought it might be a permission issue, but that is not it

    This kind of issue could also be caused by a corrupted .htaccess file. Make sure the htaccess folder could be read.

    Or may be you have to add RewriteCond to your main domain's rule :

    RewriteCond %{HTTP_HOST} !^(www\.)?addon_domain\.com
    

    where addon_domain should be replaced by the actual domain name.

    But for better help, I think, you might do better to ask your host.