Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
MattEngland2022 Posted October 4, 2022 Posted October 4, 2022 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>
Jim M Posted October 4, 2022 Posted October 4, 2022 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.
Marc Posted October 5, 2022 Posted October 5, 2022 Often this can be permissions on the file too, so that would be worth checking
MattEngland2022 Posted October 5, 2022 Author Posted October 5, 2022 Hi Both mod_setenvif and mod_rewrite are enabled and file permission is set to 644 on the .htaccess file.
Daniel F Posted October 5, 2022 Posted October 5, 2022 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/
MattEngland2022 Posted October 5, 2022 Author Posted October 5, 2022 This server is an apache server, nginx disabled or it should be
Daniel F Posted October 5, 2022 Posted October 5, 2022 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
MattEngland2022 Posted October 6, 2022 Author Posted October 6, 2022 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; }
Jim M Posted October 6, 2022 Posted October 6, 2022 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?
Marc Posted October 7, 2022 Posted October 7, 2022 As mentioned by my colleague above, you need to check what the error is your server is throwing in the first instance.
Cyberg Studio AS Posted October 11, 2022 Posted October 11, 2022 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.
Recommended Posts