Solved Help with htaccess and htpasswd File Protection


starchase

Well-known member
Member
Local time
11:57 AM
Posts
164
OS
Windows 11 Home, ver 23H2 build 22631.2428
This can be moved to a more appropriate forum if required. I apologize for the length!

To block Spam I'm pulling out my hair trying to password-protect a file containing a form to add an entry to a guestbook. Vile Porn Spam has now started to inundate it. I had the function working for a number of years but changes I've made to the website somehow have made this function inoperable. I'm at my wits end trying to figure out how to employ these two files, the .htaccess and .htpasswd files to no avail. "You're my only hope." Presently, as a workaround, I'm using a formmail function and will add entries manually to the Guestbook, but it sure would be nice to have these 2 files work like they are supposed to and have the form add the input automatically.

Here's the story. My Guestbook ( St. Norberts Alumni and Friends Comment Log ) has a link to a file in a subfolder of the Root that explains how to add entries to the Guestbook. The site is a high school alumni site so it doesn't get a lot of traffic, which is why in my explanation to visitors I give them the user name and the password to use after they click on a supplied link to an immediate subfolder that contains the actual form. So it used to be after they read the instructions on this web page which I'll describe as a gateway page, they click on the link to the form and the apache authorization dialog pops up so they can enter the User Name and the Password, which then reveals the page containing the form to fill out.

Google has tons of search results for working with the htpasswd and htaccess files but amazingly enough none of them are written in such a way as to be clear where they go, in which folders they are to sit; or they are written to be used in some WYSIWYG type of web builder. I've tried to follow all the instructions trying to deciper file placement but notheing has worked so far. Even using my Host's cPanel to secure a folder or file is not working! I am about to give up and just rely on manually adding a visitor's data after they send me a formmail message.

Tectite's formmail ( www.tectite.com ), written in PHP, is good for this as it is made to encompass Google's RECAPTCHA v.2, which I'm hoping stops the vast majority of the Spam I get. And the Guestbook is the old one of Matt's Scripts, which "nms" has updated (see www.scriptarchive.com/nms.html ), which works very well; it is written in Perl so I can't figure out how to get Google's recaptcha v.2 working on it like Tectite is for their formmail. The Google recaptcha instructions claim that it can be used anywhere but their instructions are seemingly not made for normal humans, and are unfathomable to me!

So this is a really long way around to ask if anyone has the solution for using the basic, old-fationed htpasswd and htaccess to protect the form submission file in the subfolder of the Gateway web page?

Probably not but its my last gasp effort to get the web to work the way its supposed to!

Thanks for listening, if anyone is still with me!

John
 

My Computers

System One System Two

  • OS
    Windows 11 Home, ver 23H2 build 22631.2428
    Computer type
    Laptop
    Manufacturer/Model
    Hewlett-Packard Spectre 13-4001 x360 convertable
    CPU
    Intel Core i5 5200U @ 2.20GH
    Motherboard
    Hewlett-Packard 802D
    Memory
    4 GB
    Graphics Card(s)
    Intel HD Graphics 5500 on board
    Sound Card
    Intel Smart Sound Technology (Intel SST)
    Hard Drives
    ADATA SSD 128GB, model AXNS381E-128GM-B (SATA 6.0 Gb/s
    Keyboard
    Model # G01KB
    Antivirus
    Microsoft Defender
    Other Info
    born on date: 25 Feb 2016
  • Operating System
    Win 10 22H2 build 19045.3693
    Computer type
    PC/Desktop
    Manufacturer/Model
    Asus Desktop model M32AD-US019S (new 2015)
    CPU
    Intel Core i7 4th Gen 4790 (3.60GHz), Haswell 22nm Technology, SOCKET 1150
    Motherboard
    H81M-E/M51AD/DP_MB
    Memory
    16 GB (8GB in 2 modules)
    Graphics card(s)
    NVIDIA GeForce GTX 760, 3GB
    Monitor(s) Displays
    HP EliteDisplay E241i LED; HP EliteDisplay E243
    Hard Drives
    Samsung 500GB SSD, 870 EVO (SATA 6.0 )
    Micron 250GB SSD, CT250MX500
    Toshiba HDD, 3GB (original drive w/PC)
    Case
    ASUS
    Keyboard
    ASUS-------------------------
    Antivirus
    MS Defender
What your question have to do with Windows 11?
 

My Computer

System One

  • OS
    Windows 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    HP Pavilion
    CPU
    AMD Ryzen 7 5700G
    Motherboard
    Erica6
    Memory
    Micron Technology DDR4-3200 16GB
    Graphics Card(s)
    NVIDIA GeForce RTX 3060
    Sound Card
    Realtek ALC671
    Monitor(s) Displays
    Samsung SyncMaster U28E590
    Screen Resolution
    3840 x 2160
    Hard Drives
    SAMSUNG MZVLQ1T0HALB-000H1
What your question have to do with Windows 11?
Yeah, not much, but there will be a place somewhere on the forum that this can be shoehorned into. I thought of putting it into off-topic forum but didn't think anyone would see it. I know it's off-topic but I'm at the end of my rope concerning this issue and hoped people would be a tad forgiving. And I might even find a solution. I know it's a fairly basic Internet Security topic and I thought there might quite a number of people with the appropriate experience on which I could draw.
 

My Computers

System One System Two

  • OS
    Windows 11 Home, ver 23H2 build 22631.2428
    Computer type
    Laptop
    Manufacturer/Model
    Hewlett-Packard Spectre 13-4001 x360 convertable
    CPU
    Intel Core i5 5200U @ 2.20GH
    Motherboard
    Hewlett-Packard 802D
    Memory
    4 GB
    Graphics Card(s)
    Intel HD Graphics 5500 on board
    Sound Card
    Intel Smart Sound Technology (Intel SST)
    Hard Drives
    ADATA SSD 128GB, model AXNS381E-128GM-B (SATA 6.0 Gb/s
    Keyboard
    Model # G01KB
    Antivirus
    Microsoft Defender
    Other Info
    born on date: 25 Feb 2016
  • Operating System
    Win 10 22H2 build 19045.3693
    Computer type
    PC/Desktop
    Manufacturer/Model
    Asus Desktop model M32AD-US019S (new 2015)
    CPU
    Intel Core i7 4th Gen 4790 (3.60GHz), Haswell 22nm Technology, SOCKET 1150
    Motherboard
    H81M-E/M51AD/DP_MB
    Memory
    16 GB (8GB in 2 modules)
    Graphics card(s)
    NVIDIA GeForce GTX 760, 3GB
    Monitor(s) Displays
    HP EliteDisplay E241i LED; HP EliteDisplay E243
    Hard Drives
    Samsung 500GB SSD, 870 EVO (SATA 6.0 )
    Micron 250GB SSD, CT250MX500
    Toshiba HDD, 3GB (original drive w/PC)
    Case
    ASUS
    Keyboard
    ASUS-------------------------
    Antivirus
    MS Defender
I did think of one other solution that worked, and that was that I found a 10 year old backup that I substituted for the current files and it worked. So I marked this as solved.
 

My Computers

System One System Two

  • OS
    Windows 11 Home, ver 23H2 build 22631.2428
    Computer type
    Laptop
    Manufacturer/Model
    Hewlett-Packard Spectre 13-4001 x360 convertable
    CPU
    Intel Core i5 5200U @ 2.20GH
    Motherboard
    Hewlett-Packard 802D
    Memory
    4 GB
    Graphics Card(s)
    Intel HD Graphics 5500 on board
    Sound Card
    Intel Smart Sound Technology (Intel SST)
    Hard Drives
    ADATA SSD 128GB, model AXNS381E-128GM-B (SATA 6.0 Gb/s
    Keyboard
    Model # G01KB
    Antivirus
    Microsoft Defender
    Other Info
    born on date: 25 Feb 2016
  • Operating System
    Win 10 22H2 build 19045.3693
    Computer type
    PC/Desktop
    Manufacturer/Model
    Asus Desktop model M32AD-US019S (new 2015)
    CPU
    Intel Core i7 4th Gen 4790 (3.60GHz), Haswell 22nm Technology, SOCKET 1150
    Motherboard
    H81M-E/M51AD/DP_MB
    Memory
    16 GB (8GB in 2 modules)
    Graphics card(s)
    NVIDIA GeForce GTX 760, 3GB
    Monitor(s) Displays
    HP EliteDisplay E241i LED; HP EliteDisplay E243
    Hard Drives
    Samsung 500GB SSD, 870 EVO (SATA 6.0 )
    Micron 250GB SSD, CT250MX500
    Toshiba HDD, 3GB (original drive w/PC)
    Case
    ASUS
    Keyboard
    ASUS-------------------------
    Antivirus
    MS Defender
Back
Top Bottom