Title: .htaccess code for tracking pixel for multisite
Last modified: August 22, 2016

---

# .htaccess code for tracking pixel for multisite

 *  Resolved [Benny](https://wordpress.org/support/users/bvl/)
 * (@bvl)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/htaccess-code-for-tracking-pixel-for-multisite/)
 * On the Advanced settings page, Tracking pixel this code is shown to enable the
   tracking pixel feature:
 *     ```
       RewriteBase /www.thesite.com/
       #Begin Knews (add this lines just after the RewriteBase line)
       RewriteRule ^wp-content/uploads/knewsimages/([^/]+).(jpg|jpeg|gif|png)$ /www.thesite.com/wp-content/plugins/knews/direct/track.php?img=$1 [L,NC]
       #End Knews (that's all, your htaccess should continue as is...)
       ```
   
 * The above RewriteRule ofcourse doesn’t work for a multisite setup.
    **What is
   the correct rewrite rule in case of multisite? **
 * [https://wordpress.org/plugins/knews/](https://wordpress.org/plugins/knews/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Thread Starter [Benny](https://wordpress.org/support/users/bvl/)
 * (@bvl)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/htaccess-code-for-tracking-pixel-for-multisite/#post-5209336)
 * Sorry to see that the author hasn’t been responding to any questions and issues
   in the last months. Hope he is well and will be back soon!
 * Anyway, I found the answer to my own question and I’ll post it here for others
   that might want to know the answer too:
 * Instead of the code given by Knews you should add:
 *     ```
       #Begin Knews Pixel Tracker Rule (add this lines just after the RewriteBase line)
       RewriteRule .*files/knewsimages/([^/]+).(jpg|jpeg|gif|png)$ /wp-content/plugins/knews/direct/track.php?img=$1 [L,NC]
       #End Knews
       ```
   
 *  Plugin Author [creverter](https://wordpress.org/support/users/creverter/)
 * (@creverter)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/htaccess-code-for-tracking-pixel-for-multisite/#post-5209355)
 * Thanks, we will add soon for multisite…
 *  [Presswurscht](https://wordpress.org/support/users/presswurscht/)
 * (@presswurscht)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/htaccess-code-for-tracking-pixel-for-multisite/#post-5209402)
 * Are there any news about the multisite compatibility? I’ve tried the above solution,
   but had no success. I can’t see the cat 😉
 *  [SpriterQC](https://wordpress.org/support/users/spriterqc/)
 * (@spriterqc)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/htaccess-code-for-tracking-pixel-for-multisite/#post-5209403)
 * Found out that this work for me on my multisite.
 * Pay attention, this rewrite rules use a tracking pixel image (that does not exist)
   to execute a program. As such, this rewrite rule needs to be adpated based on
   where knews will try to find the image. In ma case this is in /sites/9/knewsimages/
 * Please edit the below rewrite rule accordingly
 *     ```
       rewrite ^/wp-content/uploads/sites/9/knewsimages/([^/]+).(jpg|jpeg|gif|png)$ "/wp-content/plugins/knews/direct/track.php?img=$1" break;
       ```
   
 *  [Presswurscht](https://wordpress.org/support/users/presswurscht/)
 * (@presswurscht)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/htaccess-code-for-tracking-pixel-for-multisite/#post-5209404)
 * Thank you for reply, but this doesn’t work for me. Got a internal error. Anyone
   else? 🙁

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘.htaccess code for tracking pixel for multisite’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/knews_c1dde7.svg)
 * [Knews Multilingual Newsletters](https://wordpress.org/plugins/knews/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/knews/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/knews/)
 * [Active Topics](https://wordpress.org/support/plugin/knews/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/knews/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/knews/reviews/)

## Tags

 * [htaccess](https://wordpress.org/support/topic-tag/htaccess/)
 * [multisite](https://wordpress.org/support/topic-tag/multisite/)
 * [tracking pixel](https://wordpress.org/support/topic-tag/tracking-pixel/)

 * 5 replies
 * 4 participants
 * Last reply from: [Presswurscht](https://wordpress.org/support/users/presswurscht/)
 * Last activity: [10 years, 11 months ago](https://wordpress.org/support/topic/htaccess-code-for-tracking-pixel-for-multisite/#post-5209404)
 * Status: resolved