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.

Need help on adding banners to customer site

Discussion in 'General Discussion' started by flavesta, Dec 2, 2003.

  1. flavesta

    flavesta Member

    Joined:
    Sep 19, 2003
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Hello,
    I am trying to set up a site that gives out free sites (like Netfirms.com or tripod does) but on a smaller level (all content related free sites aloud) But I want to put my banner on top of their site automatically without having them have to copy / paste the html into their pages.

    Is it possible to do this using an Apache Handler? Mime types?

    I really do not know where to start. Any help will be greatly appreciated.

    Thanks,
    Patrick Flaven
     
    #1 flavesta, Dec 2, 2003
    Last edited by a moderator: Nov 12, 2015
  2. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    Here is what I found somewhere when I was looking for the same thing. Don't remember where though.

     
  3. flavesta

    flavesta Member

    Joined:
    Sep 19, 2003
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    Thanks for the help! I probably never would have found that out searching by myself... (I'm basically a newbie) I've never use a .htaccess file before so I'm not too familiar but im sure I can find some more info somewhere

    Thanks again
    Pat
     
    #3 flavesta, Dec 2, 2003
    Last edited by a moderator: Nov 12, 2015
  4. PWSowner

    PWSowner Well-Known Member

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

    GOT Get Proactive!

    Joined:
    Apr 8, 2003
    Messages:
    900
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Norfolk, VA
    cPanel Access Level:
    DataCenter Provider
    Also, if you chown the file to root and only allow read access, the client will not be able to delete or change it.
     
  6. flavesta

    flavesta Member

    Joined:
    Sep 19, 2003
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    When making the .htaccess file I put this code in the file

    PHP:

    php_value auto_append_file /home/myusername/public_html/ad.php

    AddType application/x-httpd-php htm

    AddType application/x-httpd-php html

    Then I made the ad.php file through dreamweaver using html code for a banner and it doesn't work, it gets an internal server error. Am I putting the code in correctly, is there something missing here... I have tried many variations and it still will not work?
     
  7. GOT

    GOT Get Proactive!

    Joined:
    Apr 8, 2003
    Messages:
    900
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Norfolk, VA
    cPanel Access Level:
    DataCenter Provider
    I just ran a test on this and it worked great. Great tip.

    As to why you are getting an internal server error, I am not sure. I used exactly what you put in your message in my .htaccess file.

    Do you have open_basedire in effect? If so, you are definately going to have problems doing it this way, but it should not return an internal server error, it should give you php warnings/errors.
     
  8. GOT

    GOT Get Proactive!

    Joined:
    Apr 8, 2003
    Messages:
    900
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Norfolk, VA
    cPanel Access Level:
    DataCenter Provider
    Oh, wait, did you put PHP: in your .htaccess file? If you did, that is what is causing it to choke. this should be the content of your .htaccess file:

    php_value auto_append_file /home/username/public_html/ad.php

    AddType application/x-httpd-php htm

    AddType application/x-httpd-php html
     
  9. flavesta

    flavesta Member

    Joined:
    Sep 19, 2003
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    That was what it was... I removed the PHP from the top and it works great! Finally it all works!! I've tried other forums but I couldn't find any help there, just want to say thanks for the help squirrel and GotHosting!
     
  10. icanectc

    icanectc Well-Known Member

    Joined:
    Mar 10, 2003
    Messages:
    344
    Likes Received:
    0
    Trophy Points:
    16
    If we are using phpsuexec how would we go about getting this to work? With PHPSUEXEC it just produces an internal server error.
     
  11. GOT

    GOT Get Proactive!

    Joined:
    Apr 8, 2003
    Messages:
    900
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Norfolk, VA
    cPanel Access Level:
    DataCenter Provider
    If using PHP Suexec, you need to put it in a file called php.ini
     
  12. PWSowner

    PWSowner Well-Known Member

    Joined:
    Nov 10, 2001
    Messages:
    2,948
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    ON, Canada
    Is it possible to add code to the .htaccess file so that the .htaccess file can be in the root (public_html) directory but only add to files in subdirectories? Or is there a line of code that can tell it not to touch specific files?
     
  13. mike_r

    mike_r Well-Known Member

    Joined:
    Nov 26, 2002
    Messages:
    45
    Likes Received:
    0
    Trophy Points:
    6
    Well, This doesnt works for CGI and SHTML, how to make it work for them.. any idea ???
     
  14. Roy@ENHOST

    Roy@ENHOST Well-Known Member

    Joined:
    Mar 5, 2002
    Messages:
    495
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Los Angeles California
    It will not work if some smart a** used a php exit() at the end of the file. But I doubt anyone will figure it out....

    Good job squirrel.
    You never fail to amaze me with how much you know about servers.
     
  15. Roy@ENHOST

    Roy@ENHOST Well-Known Member

    Joined:
    Mar 5, 2002
    Messages:
    495
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Los Angeles California
    One note.

    The page will display an error msg if the ad.php is not present. Is it possible to suppress the errors?
     
  16. Roy@ENHOST

    Roy@ENHOST Well-Known Member

    Joined:
    Mar 5, 2002
    Messages:
    495
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Los Angeles California
    oh yeah to disable deletion of the htaccess file simply do a chattr _i .htaccess

    This way it cannot be deleted by anyone including you.
    To delete it, do a
    chattr -i .htaccess
    then delete it normally.

    Now anyone knows how to suppress errors for htaccess files?
     
  17. luckyphil

    luckyphil Registered

    Joined:
    Apr 27, 2004
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    Just wondered if anyone is using this with cerberus helpdesk installed on the same domain without any problems? It causes an email error with piped emails to the helpdesk. If they are, would they be kind enough to share the fix?

    Thanks

    Phil
     
  18. wookiee

    wookiee Well-Known Member

    Joined:
    Feb 28, 2005
    Messages:
    48
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Las Vegas
    Thanks

    This thread was very helpful
     
  19. advisor

    advisor Member

    Joined:
    Feb 23, 2003
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    1
    Use an apache module called mod_layout

    tangent.org/index.pl?lastnode_id=478&node_id=362

    Good luck!
     
    #19 advisor, Apr 8, 2005
    Last edited by a moderator: Nov 12, 2015
  20. junglecat

    junglecat Well-Known Member

    Joined:
    Jul 6, 2004
    Messages:
    168
    Likes Received:
    0
    Trophy Points:
    16
    Is there any way to do something similar for pages that already use the php extension?
     
Loading...

Share This Page