webbhost

Well-Known Member
Feb 4, 2004
48
0
156
is it possible so that say someone chooses the package named "free" on my website, a banner is automatically added onto the top of all their pages, but for ones like bronze, silver and gold package, there would be no banner inserted?
 

webbhost

Well-Known Member
Feb 4, 2004
48
0
156
now thats useful, but i got 1 slight problem still... the banner must not display on people who pay to have websites
 

PWSowner

Well-Known Member
Nov 10, 2001
2,901
4
343
ON, Canada
That's where you would put the code in the /home/username/.htaccess files so it only applies to the accounts that have the code written to it. The drawback to that is, either the client can modify that file to remove it, or it has to be read only for the client which means they can't use it for anything else. For free hosting they don't need use of that file anyway.
 

webbhost

Well-Known Member
Feb 4, 2004
48
0
156
ok thanks, how do i make the 1 file read only, and last drawback is i need the code to display at the TOP of the page
not the bottom lol, any ideas?
 

PWSowner

Well-Known Member
Nov 10, 2001
2,901
4
343
ON, Canada
Change append to prepend to put your file at the top.

I'm not positive about the proper way to write protect the file, but I would just do "chmod /home/username/.htaccess 0444" in shell which would make it only readable. If you ever want to change it you would have to put it back to 0644. It might also work if you leave it at 0644 and do "chown root /home/username/.htaccess" which would make root be the owner and therefore the only one who can modify it.
 

webbhost

Well-Known Member
Feb 4, 2004
48
0
156
ok, thanks loads, you been lots of help, if i get stuck i know where to come ;)
 

webbhost

Well-Known Member
Feb 4, 2004
48
0
156
:P one word... YEEEEEESSSSS I JUST HCANGED ME NAME FROM WEBB-HOSTING.CO.UK TO WEBB-HOSTING.NET AND IT WORKS!!!!!!
 

PWSowner

Well-Known Member
Nov 10, 2001
2,901
4
343
ON, Canada
Not if you put it outside of the users directory. ;)

The sample shows the path being like /home/username/.... but the path can actually be to anywhere, like /home/ad.php which would prevent any user from getting to it.
 

webbhost

Well-Known Member
Feb 4, 2004
48
0
156
ok, thats worked, how can i protect the .htaccess file? users can edit or delete it with ftp even if chmod is set to 0

the user in ftp can also hcange the chmod settings
 

webbhost

Well-Known Member
Feb 4, 2004
48
0
156
im guessing htats through SSH, and if it is do i have to do it whilst in the current folder?
 

webbhost

Well-Known Member
Feb 4, 2004
48
0
156
this is ogna sound gay but i just did that and ic an STILL delete it thorugh FTP in a normal setting..... this is annoying me lol