By Jim
Hi. Ive written an html (CSS) front end with a lot of JS to generate pages on an embedded controller that has an apache server. I want to use the .htaccess authorisation to control access to various pages, but as it is all JS generated I’m not sure how to implement it. I know normally you would just create a htaccess in each directory, but this time, no directories. Can someone guide me as to how to use the authentication system inside my JS? Thanks. PS - i’m pretty new to all this type of coding, although not new to coding in general.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi @congo181,
The .htaccess authorization used with Apache does not provide a function that lets you block access to certain pages unless you provide a user and a password, as far as I’m aware.
The Apache authorization is used on a directory rather than on files. I’ll recommend trying to find another solution instead of using this one.
Regards, KDSys
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.