Attaching adds on sites server by Apache

Discussion in 'Server Operation' started by Leszek, Jul 24, 2007.

  1. Leszek

    Leszek Member

    Hi!
    Many if not the most of hosting companies which offer free webhosting attach their own adds and commercials to sites made by their users.
    I'm very curious about how could this be done with Apache and hopefully ISPConfig.
    I've heard about a module that can do this but couldn't find any information about it on the net.
    If anyone knows some good ways to do this,I'd be very grateful.
     
  2. edge

    edge Active Member Moderator

  3. Leszek

    Leszek Member

    It doesn't seem to work for me.
    Where should add.php be ?
     
  4. edge

    edge Active Member Moderator

    You will need to create it.
    It should be some php code that "randomly" loads your ads.
     
  5. Leszek

    Leszek Member

    Yes,that's pretty obvious but where should I put add.php ?
    Can I write the location of add.php somehow ?
     
  6. falko

    falko Super Moderator Howtoforge Staff

    If you use it like this: RewriteRule ^(.*) /add.php
    then add.php must be in the top folder of the web site (the document root). Of course, you can modify the rewrite rule if you want to put add.php in a subfolder.
     
  7. Leszek

    Leszek Member

    So in that case a user would have to have add.php in he's top website folder and simply delete it to get rid of the adds.
    The only way to stop users from doing this is to set another owner and permissions for add.php.But wouldn't that stop it from being executed?
     
  8. falko

    falko Super Moderator Howtoforge Staff

    No, as long as the Apache user can read it.
     

Share This Page