.htaccess not working

Hi, i installed Ampache using Softaculous Apps Installer. This software uses some .htaccess to redirect url and in his documentation specify that Apache configuration must have the “AllowOverride All” directive for the htdocs folder, but doesn’t work. I tested on a local machine and using “AllowOverride All”, works perfectly.

Thanks.

Not all .htaccess functions are enabled on free hosting, but redirect rules and rewrite rules are all fully supported.

I tried to look for your .htaccess file to check if there were any unsupported rules, but I couldn’t find any .htaccess file in your website.

The .htaccess files are under /htdocs/ampache/play or /htdocs/ampache/rest

@Michele said:
The .htaccess files are under /htdocs/ampache/play or /htdocs/ampache/rest

I checked those .htaccess files but they look fine and should work without any problems. What exactly are the symptoms of the issue you experience that make you suspect that .htaccess files don’t work?

I suspect that the files do not work because doing GET requests to those specific paths, I get a “301” HTTP error, as shown also in the cPanel access logs. The rest of the site works well.

301 is not an error code, it’s a redirect code. A response with status 301 (or any response in the range 300-399) is a redirect and should include a Location header which tells the visitor where to be redirected to.

After running some tests, I found the problem. As a result of my http request, the following message is attached: “This site requires Javascript to work, please enable Javascript in your browser or use a browser with Javascript support”. How can I remove this error/warning, considering that the http request is done by an app?

@Michele said:
After running some tests, I found the problem. As a result of my http request, the following message is attached: “This site requires Javascript to work, please enable Javascript in your browser or use a browser with Javascript support”. How can I remove this error/warning, considering that the http request is done by an app?

That response is caused by a mandatory security system present on all free hosting websites. In short, you cannot turn it off and you cannot send requests from a mobile app.

You can read more about the security system here: https://infinityfree.net/support/javascript-error-using-api-or-mobile-android-app/