PDA

View Full Version : directory protect and htaccess files


cindey
June 1st, 2010, 03:49 PM
with normal directories, a dot htaccess can protect the directory but how do we do this with photopost. For a membership gallery with access via the other service allowing access to the url of the gallery. Can I modify the included HTACCESS or not, thanks

Chuck S
June 1st, 2010, 04:27 PM
You can add to the htaccess any other such htaccess info your trying to add providing your htaccess code does not mess with the SEO stuff.

cindey
June 1st, 2010, 04:45 PM
RewriteCond %{HTTP_REFERER} !^http://*mydomain.com [NC]
RewriteCond %{HTTP_REFERER} !^http://*verificationdomain.com/ [NC]
RewriteCond %{HTTP_REFERER} !^http://*otherverificationdomain.com/ [NC]
RewriteRule /* http://www.mymaindomain.com [R,L]

I added this and it does not prohibit a direct hit to the directory. It does not re-direct to the maindomain as I want it to.
btw I added it just below the rewrite command
it did not change the other layout etc, just seems to have no affect as I have it

Chuck S
June 1st, 2010, 06:03 PM
well what exactly are you trying to do?

For example to rewrite domain.com to say www.domain.com you do something like this


Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]

cindey
June 1st, 2010, 06:37 PM
I have the standard splash pages, then a signup page for age verification. This service then allows ID/Members into the site via their sign in page. Not your standard htpasswrd/htaccess system. I do not host the passwords etc.
So anyone who wants to bookmark the page once inside can simply go to it unfettered.
from the splash pages, the links take them in/forward to the members page. I have the directory where the script is and want only those who originate from the passed directory url to get pages.
As it is now, typing the url into the address bar takes one directly to the directory. I do not want members to have to sign up with the photopost script etc.
So is there a way.
This is what is provided by the age verification system I use, added to your htaccess page

RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://*yourdomainname.com [NC]
RewriteCond %{HTTP_REFERER} !^http://*verificationservice.com/ [NC]
RewriteCond %{HTTP_REFERER} !^http://*verificationservice.com/ [NC]
RewriteRule /* http://www.placetosendbadreferers.com [R,L]

Thanks again, and sorry if being a pest

Chuck S
June 1st, 2010, 08:22 PM
well you might actually need to contact whomever makes your custom pages.

I really can only comment about our program and its operation. You can let guests view upload comment etc but thats up to you. Most users obviously have members register using our registration script. Permissions are assigned per usergroup in the usergroup permissions.

Percival
June 4th, 2010, 11:46 AM
I may be wrong, but i don't think you can use * as a "match all" wildcard the way you are doing.. In my .htaccess I am using (.*)

I'm no expert on mod_rewrite so sorry if it's not the case.