News:

The "Support Requests" forum is now viewable by guests.

Main Menu

cmode, .htaccess, index.html file to block direct access to folder??

Started by pimpyourpro, March 11, 2006, 12:45:16 PM

Previous topic - Next topic

pimpyourpro

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

webzone (archived)

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 section of your account options.
OR
2 - Put a blank index.htm file in the directory.

pimpyourpro

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

webzone (archived)

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?

Ben

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.
--Ben
Ben@freepgs.com

webzone (archived)

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.

pimpyourpro


Ben

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.
--Ben
Ben@freepgs.com

webzone (archived)

Quotesimple terms for the slow kid would be nice too

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