View Full Version : .htaccess ?!?!

08-30-2002, 07:51 AM
Hi all,

I have a PHP and apache configuration in an NT box. I've noticed if I use NT instead of *nix, I would not be able to use the .htaccess property.. the question is, does NT have something similar to .htaccess ?

I basically want to do:
- show diff. error pages. e.g. display a customised 404page instead of the default.

- Deny IP address

- enable SSI

- preventing Directory Listing.

Thanks alot!!!!

08-30-2002, 08:22 AM
You can use .htaccess on NT. The only problem is how to get a file named ".htaccess", because this is not allowed on Windows systems.

I've stuggled with this problem in Win98 and WinXP too and here's how I got it to work:

Start Notepad
Typ your .htaccess information
for example:
order allow,deny
deny from
allow from all

Save it to a file (.htaccess.txt would be nice)
Start MS-DOS- or Command-prompt
Goto the dir where you've saved .htaccess.txt
Typ "ren .htaccess.txt .htaccess" and hit enter
You could do a little check: "dir .*" [ENTER]

Option 2:

Start MS-DOS- or Command-prompt
Goto the dir where want your .htaccess
Typ "edit .htaccess" [ENTER]
Typ your .htaccess information
Close the editor
You could do a little check: "dir .*" [ENTER]

Hope this helps you out :)

Mzzl, Chris

08-31-2002, 12:38 PM
There is a simpler way :)

The name of the custom access file does not have to be .htaccess. In your apache httpd.conf file you use the AccessFileName directive to specify what the file name is. The reason why .htaccess has a dot at the beginning by convention is because this signifies a "hidden" file on *nix (and Mac too btw).


08-31-2002, 04:26 PM
But the reason I have this solution is because I don't want to have to change filenames if I upload files to a *nix system. Upgrade or just to test compatibility and if I install a program (perl or PHP) wich has a .htaccess in some dirs I don't want to have to change these.

Mzzl, Chris