Jump to content

Enable Rest API


Recommended Posts

Hi All

We are having an issue enabling the API, The .htaccess has been uploaded to /forum/api as mentioned and file permissions have been set but we just keep getting the following screen. Contents of the htaccess is also below

<IfModule mod_setenvif.c>
SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
</IfModule>
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteBase /forum/api/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
</IfModule>

Could contain: Text, Page

Link to comment
Share on other sites

Please ensure the following:

  1. You are running Apache to use the .htaccess.
  2. Both mod_setenvif and mod_rewrite are enabled. 

If you are unsure on either of these, please contact your hosting provider or server administrator for assistance.

Link to comment
Share on other sites

I have been trying to convert the htaccess to nginx rules, based on what others have posted i have tried the following but with no luck. Is there a recommended nginx config

 

# IPS API
    location /forum/api/ {
        try_files $uri $uri/ @api;
    }

    # IPS API LOCATION
    location @api {
        rewrite ^ /forum/api/index.php?$args last;
    }

Link to comment
Share on other sites

Sorry, we only provide support for Apache. If you wish to use NGINX this would be something you and a server administrator would need to resolve on your own, I’m afraid. I can move this to our community support forum if you would like to receive support from fellow clients?

Link to comment
Share on other sites

Hi MattEngland2022, 

You don't by any chance got  directory privacy//protection or htpasswd with user/pass enabled on your domain/subdomain? In case you have, you must either turn this off or add an allowance to the main .htacces file. I had the same trouble as you with enabling API on my staging domain until I added "Allow from xxx.xxx.xxx.xxx" insert server or client IP.

 

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...