Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

apache mod/filter update html source of the page

Status
Not open for further replies.

Kruzer

Programmer
Jun 16, 2000
117
US
Is there a mod or filter i could use for apache to remove say <!-- --> tags from a html page before displaying the html page?

Dano
What's your major malfunction
 
The <!-- --> tags are standard HTML (comments) and with the exception of being used for browser compatibility hacks, should normally be innocuous. Of course they appear when the source is viewed, so I could understand why you might want to remove them in some cases.

Unfortunately, I don't know of any filter in apache to remove them. Since they are valid HTML, they will be parsed and sent to the browser.

The easiest way I can think of to remove them all from a set of html files would be to use sed with a regular expression that searches for the tags and removes everything in between and then replaces it with an empty string.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top