Jump to content

Recommended Posts

Posted

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 ^_^

Posted

mod_rewrite isn't for dynamic code. Dynamic pages usually depend on scripting languages, with the exception of SSI. Anyways, this isn't a hosting support question.

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