Jump to content

Featured Replies

Posted

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

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.

Often this can be permissions on the file too, so that would be worth checking

  • Author

Hi

Both mod_setenvif and mod_rewrite are enabled and file permission is set to 644 on the .htaccess file.

Hi,

Are you sure that you're using apache?

According to your error when one calls the api subdirectory, you're running NGINX, so the provided htaccess file won't work for you!

Please see this for further instructions about converting apache rewrite rules https://www.nginx.com/blog/converting-apache-to-nginx-rewrite-rules/ 

  • Author

This server is an apache server, nginx disabled or it should be

When I open your api directory in the browser, I'm getting following error.

Could contain: Text, Page, Word

Given that it's a 500 error, you should see something in your servers error logs

  • Author

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;
    }

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?

As mentioned by my colleague above, you need to check what the error is your server is throwing in the first instance.

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.

 

 

Recently Browsing 0

  • No registered users viewing this page.