FreePgs.com Forum

FreePgs Related => Support Requests => Topic started by: pimpyourpro on March 11, 2006, 12:45:16 PM

Title: cmode, .htaccess, index.html file to block direct access to folder??
Post by: pimpyourpro on March 11, 2006, 12:45:16 PM
How should I go about denying access to a folder but not denying access to the file if they have a direct link to it?

aim:bloodshotstudio
Title: Re: cmode, .htaccess, index.html file to block direct access to folder??
Post by: webzone (archived) on March 11, 2006, 05:48:49 PM
Do you mean that you would like to remove the directory listing (list of files) that appears when someone tries to access a directory?

If it's what you're looking for, then you can:
1 - Disable "Directory Indexes" for all directories in your account using the Scripting Options (http://system.freepgs.com/options.php?sec=scripting) section of your account options.
OR
2 - Put a blank index.htm file in the directory.
Title: Re: cmode, .htaccess, index.html file to block direct access to folder??
Post by: pimpyourpro on March 12, 2006, 06:48:16 PM
ok i disabled dir indexes but look..

http://www.pimpyourpro.com/assets
http://www.pimpyourpro.com/assets/scripts

??? isn't it possible to make it just say "You don't have permission to view this section of the site" of w/e that error is??

i try'd chmode'ing it but it seems like they didn't want to work

-j
Title: Re: cmode, .htaccess, index.html file to block direct access to folder??
Post by: webzone (archived) on March 12, 2006, 07:39:54 PM
Quotei try'd chmode'ing it but it seems like they didn't want to work

chmod has nothing to do with making files available or not.

Quoteisn't it possible to make it just say "You don't have permission to view this section of the site" of w/e that error is??

Technically, it is supposed to trigger a 403 - Forbidden error if there is no index.(htm, html, php) in the directory, but I see your homepage instead. What rewrite rules are you using?
Title: Re: cmode, .htaccess, index.html file to block direct access to folder??
Post by: Ben on March 12, 2006, 07:57:13 PM
Here's his .htaccess file:

RewriteEngine On
RewriteRule ^(.+)\.html$ index.php?page=$1


That's redirecting -everything- under that directory to the index.php file of your main directory.
Title: Re: cmode, .htaccess, index.html file to block direct access to folder??
Post by: webzone (archived) on March 12, 2006, 08:44:15 PM
In fact, it only redirects all requests for files that end in .html to /index.php. However, I think that the ErrorDocument for 403 and 404 were set to error404.html and error403.html in the account options.

It would mean that, when someone requests /assets/, Apache triggers a 403 error and tries to load error403.html. It then finds the rewrite rule and tries to load index.php?page=error403 which doesn't exist.
Title: Re: cmode, .htaccess, index.html file to block direct access to folder??
Post by: pimpyourpro on March 14, 2006, 06:59:01 PM
 ???

simple terms for the slow kid would be nice too  :)
Title: Re: cmode, .htaccess, index.html file to block direct access to folder??
Post by: Ben on March 14, 2006, 07:30:34 PM
Simple solution: Change your error403.html file to error403.php and and change the options panel setting..

Edit: You don't seem to have an error403.html file.. You can change the setting back to "Default" and display the FreePgs error or to "error403.php" and create the file to display your own error.
Title: Re: cmode, .htaccess, index.html file to block direct access to folder??
Post by: webzone (archived) on March 14, 2006, 09:00:39 PM
Quotesimple terms for the slow kid would be nice too

oops. I have a tendency to describe everything with too much technical details.