GetDotted Domains

Viewing Thread:
".htaccess / quikc help"

The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.

Thu 11/11/04 at 09:03
Regular
"Lisan al-Gaib"
Posts: 7,093
Right, I'm under a tight deadline now, and need some quick fixes.

1) .htaccess file to prevent outside users from listing directory contents on the webserver
2) same to stop downloading of files I don't want downloaded (i.e. php functions)
3) An automatic forward to the root of the site from subdirectories?

I'm a little unsure as .htaccess, but need urgent help!
Thu 11/11/04 at 18:19
Regular
"Devil in disguise"
Posts: 3,151
Pandaemonium wrote:
> yeah, did this, and got a
>
> "Directory of
> -----------------
> -----------------"
>
> Which looked a little ugly. With the index.php redirectio back to the
> server root, it looks a little neater.
>
> Cheers all! It's up and running on the test server, going live
> tomorrow if there are no further issues.

Might be neater, but you should be aware that its not actually disabling directory browsing so even if you still want to use that you should keep Options -Indexes in .htaccess in your web root. Its not a big deal though, depends how security conscious you want to be.

Anyway, Options -Indexes should produce a 403 when you try to directory browse (which you can set up a ErrorDocument for in your .htacess to redirect it). I guess you have something in your apache conf thats overriding/conflicting with it though.
Thu 11/11/04 at 16:51
Regular
"Lisan al-Gaib"
Posts: 7,093
Garin wrote:
> You can just put Options -Indexes in your .htaccess file to disable
> directory browsing.

yeah, did this, and got a

"Directory of
-----------------
-----------------"

Which looked a little ugly. With the index.php redirectio back to the server root, it looks a little neater.

Cheers all! It's up and running on the test server, going live tomorrow if there are no further issues.
Thu 11/11/04 at 16:49
Regular
"Lisan al-Gaib"
Posts: 7,093
phi111ip wrote:
> Is it an Apache or Windows server?
>
> You can turn off directory listing normally.

Dunno, but I doubt our service provider would be happy with me changing their settings. I have no access to change the server software. :)

[edit] Apache, on the laptop I was developing on was locked down tight. MySQL users also handled the user logins for image upload. Once I sorted out an account to move the software too, everything changed.....Still, pretty secure now I think.
Thu 11/11/04 at 16:34
Regular
"Devil in disguise"
Posts: 3,151
You can just put Options -Indexes in your .htaccess file to disable directory browsing.
Thu 11/11/04 at 16:27
Regular
"Chavez, just hush.."
Posts: 11,080
Pandaemonium wrote:
> Ahh, sweet!
>
> How about if they type
>
> "http://www..com/images/" into the browser.
> I'd like a "restricted" to appear, or a redirect to root,
> but still be able to use the images. (I tried Error -403, but
> couldn't use the images)

Is it an Apache or Windows server?

You can turn off directory listing normally.
Thu 11/11/04 at 12:00
Regular
"Lisan al-Gaib"
Posts: 7,093
*slaps head*

DOH!. You can tell I'm moving to a live server and fixing a multitude of bugs.

Anyhoo, that works fine. Cheers!
Thu 11/11/04 at 11:30
Regular
"It goes so quickly"
Posts: 4,083
I'm afraid that I don't know all that much about .htaccess, but for directories, I just chuck an index.php file in there with:



For PHP files you don't want viewed (e.g a functions only page), use the .php extension as mentioned, but put this at the top - where functions.php is the actual filename (it'll redirect the user to a page you want):

if (eregi("functions.php", $_SERVER['PHP_SELF']))
header("Location:/index.php");
Thu 11/11/04 at 10:07
Regular
"Lisan al-Gaib"
Posts: 7,093
Ahh, sweet!

How about if they type

"http://www..com/images/" into the browser. I'd like a "restricted" to appear, or a redirect to root, but still be able to use the images. (I tried Error -> 403, but couldn't use the images)
Thu 11/11/04 at 09:50
Regular
"NULL"
Posts: 1,384
As long as your PHP functions are in .php files or another file type parsed by PHP (i.e. NOT .inc) then if anyone tries to download them, they will only get whatever that file would output normally.
Thu 11/11/04 at 09:03
Regular
"Lisan al-Gaib"
Posts: 7,093
Right, I'm under a tight deadline now, and need some quick fixes.

1) .htaccess file to prevent outside users from listing directory contents on the webserver
2) same to stop downloading of files I don't want downloaded (i.e. php functions)
3) An automatic forward to the root of the site from subdirectories?

I'm a little unsure as .htaccess, but need urgent help!

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Unrivalled services
Freeola has to be one of, if not the best, ISP around as the services they offer seem unrivalled.
First Class!
I feel that your service on this occasion was absolutely first class - a model of excellence. After this, I hope to stay with Freeola for a long time!

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.