How to keep original jpg in addressbar after RewriteRule

Viewed 44

How to keep original URL in addressbar after RewriteRule

This is a similar question on stackoverflow, but even with the answers there I can not solve this in my case.

I have this dynamic image:

https://www.glansbeton.be/teaser/glansbeton-400-400/StackOverflow_Belgium.jpg

If you open it, you can see that the htaccess is working and there is a redirect. I don't want the redirect. I want that the url is not to be changed.

##### https://www.glansbeton.be/teaser/glansbeton-400-400/koekoek_vlaanderen.jpg
RewriteRule ^teaser/glansbeton-400-400/([^\.]+)\.jpg$ https://www.glansbeton.be/teaser/glansbeton-400-400/teaser.php?keyword_city=$1 [L,NC]

Can someone give me a tip ?

1 Answers

Could you please try changing your rule to following once. Please make sure you clear your browser cache before testing your URLs.

RewriteRule ^teaser/glansbeton-400-400/([^.]+)\.jpg$ teaser/glansbeton-400-400/teaser.php?keyword_city=$1 [L,NC]
Related