Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I currently use trans.png.php?id=1&campaign=test to track my newsletter campaigns.

I want to use trans.png instead as it's the src of an img tag.

How can i do this in htaccess? Also is there any way I can disguise the get variables?

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

Try:

RewriteEngine on  
RewriteRule /([0-9a-z]+)/([0-9a-z]+)\.png /trans.png.php?id=$2&campaign=$1

Then a URL of

/campaigntest/123.png

would translate to

trans.png.php?id=123&campaign=campaigntest

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.