0
I have an offline webpage composed of Html, CSS, and JS, it runs completely offline. One problem, I want to use htaccess to add Username/Passwords to my webpage, along with other features of htaccess, like Removing url page extensions (site/page1.html > site/page1) and things like error 404 Pages and such, but when I connected my htaccess and htpasswd to my main site html file and my webpage, nothing happened when I opened the site, no password requests, no 404 pages on fake urls, no hidden file extensions. Does it only work with online sites?
In basic terms, I want to run Mainsite.html on a PRIVATE DOMAIN (just a file address or an IP (I cant really port forward so this is difficult)) and then be able to use htaccess features.
Main site name: Mainsite.html
htaccess code:
<Files ~ "^\.(htaccess|htpasswd)$">
deny from all
</Files>
Options Indexes
AuthUserFile .htpasswd
AuthGroupFile /dev/null
AuthName "Please enter your ID and password"
AuthType Basic
require valid-user
DirectoryIndex MainSite.html
order deny,allow
htpasswd code:
userAdmin:-----------
(I cant even show encrypted pass for reasons)
Related question by same OP on Stack Overflow. – slhck – 2019-05-24T13:01:43.160
@slhck How does that relate to this question, the original question was about running a website with a port forward, this was about running an offline site with features of htaccess.. – TaylorS – 2019-05-24T17:19:12.460
Quite obviously, it's about the same underlying problem (also hinted at by your comment about port forwarding below my answer). Having the full context helps others answer your question; it's always better to give the full picture when asking. See also: http://xyproblem.info/ — you're never going to get a sufficient answer if you ask about fragments of your original problem.
– slhck – 2019-05-25T10:24:53.483