GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Htaccess + htpasswd question (https://gfy.com/showthread.php?t=1102755)

Lace 03-11-2013 08:50 PM

Htaccess + htpasswd question
 
Need to use htaccess and htpasswd to protect all pages besides index.html along with all images used outside of the index.

Here's what I have so far, but it's pw protecting the index.html as well.

Code:

AuthName "Site Name"
AuthType Basic
AuthUserFile /path_to_/.htpasswd
Require valid-user

<Files "*">
Require valid-user
</Files>

<FilesMatch "(index\.html|logo\.png)$">
Allow from all
Satisfy any
</FilesMatch>


bl4h 03-11-2013 08:59 PM

not sure but I can almost guarantee that whatever youre doing, youre doing it the hard way

Lace 03-11-2013 09:02 PM

Quote:

Originally Posted by bl4h (Post 19523350)
not sure but I can almost guarantee that whatever youre doing, youre doing it the hard way

Well, yeah. I could set it up in a folder, but I'd rather not have to move everything.

TisMe 03-11-2013 09:07 PM

No expert but I think you need an ignore index line.

Something like this:

Code:

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

Paz 03-12-2013 02:02 AM

Gottit working on my server in a folder www.carlparry.com/gfy/

Quote:

# Set exception for /gfy/index.html and set as variable AdminUri for use later
SetEnvIf Request_URI "^/gfy/index.*$" AdminUri

# Setup the password protection (standard folder protect)
AuthUserFile /home/xxxxxxxxxx/carlparry.com/gfy/.htpasswd
AuthName "GFY - folder protected"
AuthType Basic
AuthUserFile ./.htpasswd
Require valid-user

# Now add the exceptions for matched URL's index.html (not standard)
Order Deny,Allow
Deny from all
Allow from env=AdminUri
Satisfy any
Cheers,
Paz.

KaliC 03-12-2013 02:19 AM

Quote:

Originally Posted by Lace (Post 19523359)
Well, yeah. I could set it up in a folder, but I'd rather not have to move everything.

Yeah, it's best to keep the htaccess files and folders in a separate protected folder.


All times are GMT -7. The time now is 12:01 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc