The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

auto inserting

Discussion in 'General Discussion' started by webbhost, Mar 5, 2004.

  1. webbhost

    webbhost Well-Known Member

    Joined:
    Feb 4, 2004
    Messages:
    48
    Likes Received:
    0
    Trophy Points:
    6
    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?
     
  2. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
  3. webbhost

    webbhost Well-Known Member

    Joined:
    Feb 4, 2004
    Messages:
    48
    Likes Received:
    0
    Trophy Points:
    6
    now thats useful, but i got 1 slight problem still... the banner must not display on people who pay to have websites
     
  4. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    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.
     
  5. webbhost

    webbhost Well-Known Member

    Joined:
    Feb 4, 2004
    Messages:
    48
    Likes Received:
    0
    Trophy Points:
    6
    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?
     
  6. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    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.
     
  7. webbhost

    webbhost Well-Known Member

    Joined:
    Feb 4, 2004
    Messages:
    48
    Likes Received:
    0
    Trophy Points:
    6
    ok, thanks loads, you been lots of help, if i get stuck i know where to come ;)
     
  8. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    This is where I posted a lot of questions when I was new. ;)
     
  9. webbhost

    webbhost Well-Known Member

    Joined:
    Feb 4, 2004
    Messages:
    48
    Likes Received:
    0
    Trophy Points:
    6
    :P one word... YEEEEEESSSSS I JUST HCANGED ME NAME FROM WEBB-HOSTING.CO.UK TO WEBB-HOSTING.NET AND IT WORKS!!!!!!
     
  10. webbhost

    webbhost Well-Known Member

    Joined:
    Feb 4, 2004
    Messages:
    48
    Likes Received:
    0
    Trophy Points:
    6
    ok, changed chmod - 1 probelm - i can still delete the file ad.php
     
  11. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    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.
     
  12. webbhost

    webbhost Well-Known Member

    Joined:
    Feb 4, 2004
    Messages:
    48
    Likes Received:
    0
    Trophy Points:
    6
    doesnt stop them editing .htaccess through

    ill try that thorugh aswell
     
  13. webbhost

    webbhost Well-Known Member

    Joined:
    Feb 4, 2004
    Messages:
    48
    Likes Received:
    0
    Trophy Points:
    6
    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
     
  14. webbhost

    webbhost Well-Known Member

    Joined:
    Feb 4, 2004
    Messages:
    48
    Likes Received:
    0
    Trophy Points:
    6
    how exatly lol
     
  15. webbhost

    webbhost Well-Known Member

    Joined:
    Feb 4, 2004
    Messages:
    48
    Likes Received:
    0
    Trophy Points:
    6
    im guessing htats through SSH, and if it is do i have to do it whilst in the current folder?
     
  16. webbhost

    webbhost Well-Known Member

    Joined:
    Feb 4, 2004
    Messages:
    48
    Likes Received:
    0
    Trophy Points:
    6
    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
     
  17. webbhost

    webbhost Well-Known Member

    Joined:
    Feb 4, 2004
    Messages:
    48
    Likes Received:
    0
    Trophy Points:
    6
    aitn there anything like a delete or writeover password
     
  18. webbhost

    webbhost Well-Known Member

    Joined:
    Feb 4, 2004
    Messages:
    48
    Likes Received:
    0
    Trophy Points:
    6
    wait - anything to do with the fact the file properties says user: 0 ?
     
Loading...

Share This Page