Jump to content

[Solved] mod_rewrite question...


Nephryrinn

Recommended Posts

I'm trying to add Google Analytics code dinamically, but I can't find any clue on making it on Apache's Rewrite.

 

After googling I reached this IIS snippet:

 

<rewrite>
<outboundRules>
 <rule name="Add tracking script" patternSyntax="ExactMatch" preCondition="">
  <match filterByTags="None" pattern="</body>" />
  <action type="Rewrite" value="<script type='text/javascript'>//Your web analytics tracking code goes here...</script></body>" />
 </rule>
<preConditions>
 <preCondition name="IsHTML">
   <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
 </preCondition>
</preConditions>
</outboundRules>
</rewrite>

 

Since we are in an Apache server, is there any way to make this work here?

 

Else, is there any other way to archieve this?

 

Thanks ^_^

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...