Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 18
  1. #1
    Member
    Join Date
    Feb 2004
    Posts
    48

    Default auto inserting

    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. #2
    Member PWSowner's Avatar
    Join Date
    Nov 2001
    Location
    ON, Canada
    Posts
    2,994
    Mike
    WHM and cPanel Scripts (join our "Scripts Club")
    D/A Photography

  3. #3
    Member
    Join Date
    Feb 2004
    Posts
    48

    Default

    now thats useful, but i got 1 slight problem still... the banner must not display on people who pay to have websites

  4. #4
    Member PWSowner's Avatar
    Join Date
    Nov 2001
    Location
    ON, Canada
    Posts
    2,994

    Default

    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.
    Mike
    WHM and cPanel Scripts (join our "Scripts Club")
    D/A Photography

  5. #5
    Member
    Join Date
    Feb 2004
    Posts
    48

    Default

    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. #6
    Member PWSowner's Avatar
    Join Date
    Nov 2001
    Location
    ON, Canada
    Posts
    2,994

    Default

    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.
    Mike
    WHM and cPanel Scripts (join our "Scripts Club")
    D/A Photography

  7. #7
    Member
    Join Date
    Feb 2004
    Posts
    48

    Default

    ok, thanks loads, you been lots of help, if i get stuck i know where to come

  8. #8
    Member PWSowner's Avatar
    Join Date
    Nov 2001
    Location
    ON, Canada
    Posts
    2,994

    Default

    This is where I posted a lot of questions when I was new.
    Mike
    WHM and cPanel Scripts (join our "Scripts Club")
    D/A Photography

  9. #9
    Member
    Join Date
    Feb 2004
    Posts
    48

    Default

    :P one word... YEEEEEESSSSS I JUST HCANGED ME NAME FROM WEBB-HOSTING.CO.UK TO WEBB-HOSTING.NET AND IT WORKS!!!!!!

  10. #10
    Member
    Join Date
    Feb 2004
    Posts
    48

    Default

    ok, changed chmod - 1 probelm - i can still delete the file ad.php

  11. #11
    Member PWSowner's Avatar
    Join Date
    Nov 2001
    Location
    ON, Canada
    Posts
    2,994

    Default

    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.
    Mike
    WHM and cPanel Scripts (join our "Scripts Club")
    D/A Photography

  12. #12
    Member
    Join Date
    Feb 2004
    Posts
    48

    Default

    doesnt stop them editing .htaccess through

    ill try that thorugh aswell

  13. #13
    Member
    Join Date
    Feb 2004
    Posts
    48

    Default

    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. #14
    Member
    Join Date
    Feb 2004
    Posts
    48

    Default

    how exatly lol

  15. #15
    Member
    Join Date
    Feb 2004
    Posts
    48

    Default

    im guessing htats through SSH, and if it is do i have to do it whilst in the current folder?

Similar Threads & Tags
Similar threads

  1. inserting meta tag
    By jesslynalvin in forum New User Questions
    Replies: 6
    Last Post: 08-17-2011, 06:10 AM
  2. recursive folders /usr/local/cpanel/perl/auto/auto/auto/auto...
    By bigste in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 10-15-2009, 12:52 AM
  3. Editing or inserting ALT Attribute for Image
    By drdick in forum Security
    Replies: 20
    Last Post: 07-13-2009, 10:29 AM
  4. blank page after inserting email password
    By sebans in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 07-23-2004, 07:20 PM
  5. auto inserting
    By webbhost in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 03-05-2004, 01:36 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube