Mobile app version of vmapp.org
Login or Join
Barnes591

: Htaccess - Rewrite png to php file 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

@Barnes591

Posted in: #Apache #Htaccess #ModRewrite #UrlRewriting

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?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Barnes591

1 Comments

Sorted by latest first Latest Oldest Best

 

@Sarah324

Try:

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


Then a URL of

/campaigntest/123.png

would translate to

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

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme