1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Setup For .html/.htm Files Without A Footer File

Discussion in 'Co-op Advertising Network' started by digitalpoint, Dec 1, 2004.

  1. Colleen

    Colleen Illustrious Member

    Messages:
    6,778
    Likes Received:
    725
    Best Answers:
    1
    Trophy Points:
    430
    #121
    I don't even know anymore. :( It's in the first post.
    SEMrush
     
    Colleen, Jun 5, 2005 IP
    SEMrush
  2. Infiniterb

    Infiniterb Well-Known Member

    Messages:
    1,314
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    168
    #122
    It sounds like Lady is trying to get .html/.htm files to display the co-op code using what shawn provided in the first post of this thread. The problem here is that some hosts won't process the code in the .htaccess file. Matt's example works, but Shawn's, for some reason, doesn't.
     
    Infiniterb, Jun 5, 2005 IP
  3. Thewormman

    Thewormman Peon

    Messages:
    95
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #123
    Maybe no-one has talked about the method I mentioned :eek:

    The trouble with this is it makes the server parse ALL the pages as shtml which takes a bit longer.

    Anyway, that method never worked for me but this method did and is really simple.

    1. Put the line

    XBitHack full

    in your root htaccess file at the top so it gets processed first.

    2. Place the shtml include code for the ads in your html page where you want them to show.

    3. Chmod your permissions on that page as 755 executable.

    Now every time the page is called, as long as you can process server includes with your hosting set up, that page will be parsed as well.
    Any html pages you don't want to parse just leave permissions as 644 usually the default.

    This will only work with Apache servers.
    Another advantage is that no-one knows you are adding things dynamically as you still show the static html extension.

    Thats it! :D

    Reference: http://httpd.apache.org/docs/howto/ssi.html
     
    Thewormman, Jun 5, 2005 IP
  4. success108

    success108 Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #124
    Hi I'm a newbie, still learning
    Does this mean you can have multiple "funcitions" in the root htaccess file? I already have one and I don't want to screw it up.

    Do you mean this? <!--#include virtual="/ad_network_###.php" -->

    Is this necessary? If it is, is there a way to change the permission of multiple pages at once in C panel, I have a lot of pages.
     
    success108, Jun 7, 2005 IP
  5. Thewormman

    Thewormman Peon

    Messages:
    95
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #125
    Yes, but make a backup and always check immediately to make sure there are no conflicts with what is in there already.
    Yes
    As far as I know you have to change each page in cPanel. Try using an ftp program like WS_FTP Pro from www.ipswitch.com it allows you to highlight and change all the contents of directories in one go and it is free to download.
     
    Thewormman, Jun 7, 2005 IP
  6. kdobson99

    kdobson99 Guest

    Messages:
    161
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #126
    After reading this thread, I am a little confused at the various approaches. I am not a good programmer but can follow directions halfway decent... Can someone give me the most simple way to get MULTIPLE ads to display with the following setup...

    The main content pages of the site are php based, however it was originally designed to include an html footer file, rather than a php footer. I don't really want to change this on the various pages, but I want to put the ad code in the html footer file. I have it set apache to parse html and htm as php, and I thought that would fix it, but didn't, so now I am here trying to decide which advice in this thread actually worked and which didn't etc. Mod rewrite is supported on the server btw.

    Can someone give me an ABC,123 on doing it with this setup. Again, I want to display 5 ads in the html footer file.

    Thanks
     
    kdobson99, Jun 7, 2005 IP
  7. success108

    success108 Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #127
    Thanks for answering my questions wormman.
     
    success108, Jun 7, 2005 IP
  8. davshirley

    davshirley Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #128
    To those of you that are getting 500 error code: I too had the same problem and it was because the mod-rewrite script was getting locking in an infinite loop. In addition, the rewrite condition does not take effect if a request comes in for / (your index page). Here is what I am using now:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule ^$ /passthru.php?file=index.html
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} ^(.*)\.htm [NC,OR]
    RewriteCond %{REQUEST_FILENAME} ^(.*)\.html [NC]
    RewriteRule ^(.*) /passthru.php?file=$1
    </IfModule>


    Note the first change (RewriteRule ^$ /passthru.php?file=index.html) will make it work with requests for / assuming that your index page is named index.html. Adjust that line if your index page is named something different.

    The next change is in the two RewriteCond lines. Note the \ before the .htm and .html. Their presence stops the infinite loop that I referenced earlier. I have no idea way. Some servers that I use require the \ by there and others do not. I'd really love to hear the explaination if anyone has it....
     
    davshirley, Jun 12, 2005 IP
  9. Foxy

    Foxy Chief Natural Foodie

    Messages:
    1,614
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #129
    Hi

    That stopped the 500 error but I now have

    Parse error: parse error, unexpected T_STRING in /home/domain/public_html/passthru.php on line 3

    unfortunately
     
    Foxy, Jun 13, 2005 IP
  10. asc44

    asc44 Peon

    Messages:
    10
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #130
    Hi,

    My ads display don't fit with the design.
    How can we add a "div" tag to format ads display?

    I'm guess, it's near the line of "echo preg_replace"
    but I don't know how to insert additional code.

    Such as, if I want to align "center" the ads, what code I've to add?

    Thank you in advance for your help!


    <?php
    
    if (!function_exists('file_get_contents')) {
    function file_get_contents($url) {
    $handle = fopen($url, 'r');
    $string = fread($handle, 4096000);
    fclose($handle);
    return $string;
    }
    }
    
    include ('ad_network.php');
    echo preg_replace ("/<\/body>/i", $ad_network[0] . '</body>', file_get_contents(str_replace ('../', '', $_REQUEST['file'])));
    
    ?>
    Code (markup):
     
    asc44, Jun 15, 2005 IP
  11. joeldavuk

    joeldavuk Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #131
    is there a way to make certain files be an exception to the rule?

    i use the following

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} ^(.*).htm [NC,OR]
    RewriteCond %{REQUEST_FILENAME} ^(.*).html [NC]
    RewriteRule ^(.*) passthru.php?file=$1
    </IfModule>

    for example if i wanted thanks.htm to not be proccessed in this manner how would i do it?
     
    joeldavuk, Jun 15, 2005 IP
  12. joeldavuk

    joeldavuk Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #132
    i would replace the echo with the following.

    
    
    echo preg_replace ("/<\/body>/i", "<div align=\"middle\">$ad_network[0]</div>". '</body>', file_get_contents(str_replace ('../', '', $_REQUEST['file'])));
    Code (markup):
     
    joeldavuk, Jun 15, 2005 IP
  13. asc44

    asc44 Peon

    Messages:
    10
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #133
    joeldavuk,

    Thanks very much! :)
     
    asc44, Jun 15, 2005 IP
  14. asc44

    asc44 Peon

    Messages:
    10
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #134
    Hello All,

    Want any experts please help.

    I've tried to add DP Ads (parse through html) to another old site, but it's not success.

    I've checked apache module, the module_rewrite was loaded.

    I've followed to all instructions in this thread.
    But it displayed no ads, no errors.

    Although I've successfully done this with other server.

    I've checked the apache log "/var/log/httpd/error", no errors about the module.

    Can anyone help suggest how to fix the problem?

    I'm really appreciate your help! :)

    Thank you...
     
    asc44, Jun 22, 2005 IP
  15. donnareed

    donnareed Peon

    Messages:
    340
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #135
    Does anyone know if this method works with the latest new .php file? (the one with tracking stats etc.)?
     
    donnareed, Jun 24, 2005 IP
  16. jyoti2005

    jyoti2005 Peon

    Messages:
    43
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #136
    My website keeps disappearing whenever I try to put the .htaccess file up on the server.

    I put the following content into the file:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} ^(.*).htm [NC,OR]
    RewriteCond %{REQUEST_FILENAME} ^(.*).html [NC]
    RewriteRule ^(.*) /passthru.php?file=$1
    </IfModule>


    I checked my error log and got the following:
    "mod_rewrite: maximum number of internal redirects reached. Assuming configuration error.
    Use 'RewriteOptions MaxRedirects' to increase the limit if neccessary."

    What should I do?

    Thanks!
     
    jyoti2005, Jul 1, 2005 IP
  17. GADOOD

    GADOOD Peon

    Messages:
    1,745
    Likes Received:
    241
    Best Answers:
    0
    Trophy Points:
    0
    #137
    Man, I thought about joining the coop until I read this thread and all the complexities of setting it up on a .html site. Bollocks to that, it's nigh impossible to understand any of it and I've been making websites for 10 years! You have to be a super nerd or something. I guess I'll just keep working at my link building instead. Jesus! :mad:

    Memories of trying to play a hard tune on the piano when I was 11 are flooding back and I'm getting angry instead of upset this time.. at no-one inparticular. Just angry. :p

    Pete
     
    GADOOD, Jul 27, 2005 IP
  18. Cyclops

    Cyclops sensei

    Messages:
    1,241
    Likes Received:
    72
    Best Answers:
    0
    Trophy Points:
    0
    #138
    :D Join the club..it is daunting and I felt the same as you, however I found there are some nice people here at DP who will do it for you....usually for a small fee :)
    It really is worth perserving with though so don't give up too soon.
     
    Cyclops, Jul 27, 2005 IP
  19. Foxy

    Foxy Chief Natural Foodie

    Messages:
    1,614
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #139
    Why are you getting angry?????

    This is for free ....... I can't get it to work on my html pages either ....but that is not the fault of Shawn or the coop....that is the fault of the servers and how they react with the code.

    So chill out a little and take what is good from here.

    You may need to change your site to php, which is quite easy, and then the problems just disappear, and I can assure you that the time taken to do that is a lot less than looking for reciprocals!!!!;)
     
    Foxy, Jul 28, 2005 IP
  20. fryman

    fryman Kiss my rep

    Messages:
    9,605
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    370
    #140
    Heck, I had to pay some guy 50 bucks to modify some things in my site and get the coop to work :D

    Whining about it won't help you at all... if you can't figure it out, either get someone to do it for you, or just forget about it
     
    fryman, Jul 28, 2005 IP