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.

Can i hide parts of a webpage content via some Apache module?

Discussion in 'Apache' started by postcd, Mar 8, 2017.

  1. #1
    there are Apache modules like pagespeed which rewrite page upon serving it to the customer
    there is mod_security module which i hope can also do actions based on page content

    so how can i please hide/remove parts of webpage while sending it from the server to the visitor?

    Example, i want to remove this from certain or all Apache served pages:
    <a href="http://badsite.com/?a=123">Link text</a>
    so my question is how to do it please? How to intercept/modify data Apache is going to send to my website visitor? Thank you in advance
    postcd, Mar 8, 2017 IP
  2. KingViper

    KingViper Member

    Likes Received:
    Best Answers:
    Trophy Points:
    I might be wrong,
    but I don't think you could do this on the server level.
    I believe you would need to fetch the web page first, then remove the link based on a predefined regex (could be done with javascript, but also with PHP) and then serve it to the visitor. This would require you to act as a proxy between the origin and the visitor and depending on the number of visitors and different sites which you need to process, it might be quite expensive in terms of server resources.
    KingViper, Mar 9, 2017 IP
  3. PoPSiCLe

    PoPSiCLe Illustrious Member

    Likes Received:
    Best Answers:
    Trophy Points:
    You could probably do this via one of the proxy-scripts for Apache - Varnish, for instance. However, this is quite demanding on server resources, and would normally be running on a separate server, not on the same box as the webserver itself.
    PoPSiCLe, Mar 9, 2017 IP
  4. postcd

    postcd Well-Known Member

    Likes Received:
    Best Answers:
    Trophy Points:
    thx, i need some tutorial or example, so if no one knows how to do it exactly (i do not use Varnish, i use Apache+Mod Security), please share phrasse/s that i will search in Google to discover how to do it. Thx
    postcd, Mar 13, 2017 IP