where does .htaccess go?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

where does .htaccess go?

Post by Chris Corbyn »

Hi,

I need to create the .htaccess file for my site but I was wondering since my site does not run from the base directory on my server space and from a folder one depth in do I still put .htaccess in the base directory or in the folder that contains the index file?

Thanks
magicrobotmonkey
Forum Regular
Posts: 888
Joined: Sun Mar 21, 2004 1:09 pm
Location: Cambridge, MA

Post by magicrobotmonkey »

put them in each folder - set them to whatever security you want in the given folder. They each reign over their own folder. The base dir- if you don't serve out of it you'll probably want all access denied then the served dir allow php or whatever.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Ok thanks, that clears that up. I'm struggling to create the file itself too.

Because I'm working on a windows platform ftp'ing to the server my files are on, windows just displays a message saying you must enter a filename (because there's nothing before the dot). Do I need to use some different software to do this?
magicrobotmonkey
Forum Regular
Posts: 888
Joined: Sun Mar 21, 2004 1:09 pm
Location: Cambridge, MA

Post by magicrobotmonkey »

when you save it put it in quotes - in notpad put ".htaccess" in the save as box
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Oh, I feel a bit stupid now :oops: LOL

Thanks.
magicrobotmonkey
Forum Regular
Posts: 888
Joined: Sun Mar 21, 2004 1:09 pm
Location: Cambridge, MA

Post by magicrobotmonkey »

thats cool - its a little bit of a wierd thing to know - i wouldn't have known it if i had stumbled across it on these forums once...
Post Reply