Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted October 4, 20222 yr 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>
October 4, 20222 yr Please ensure the following: You are running Apache to use the .htaccess. 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.
October 5, 20222 yr Author Hi Both mod_setenvif and mod_rewrite are enabled and file permission is set to 644 on the .htaccess file.
October 5, 20222 yr 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/
October 5, 20222 yr When I open your api directory in the browser, I'm getting following error. Given that it's a 500 error, you should see something in your servers error logs
October 6, 20222 yr 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; }
October 6, 20222 yr 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?
October 7, 20222 yr As mentioned by my colleague above, you need to check what the error is your server is throwing in the first instance.
October 11, 20222 yr 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.