How can I keep the same the URL, but display a different page on the server using .htaccess rewrite rule?
I'm working on hotlink protection. The playlist is generated with the following link: http://site.com/get.playlist.php?
the full link:
http://site-1.com/get.playlist.php?playlist=http://site.com/video/34141ce7760f58f0c3eb5e0c758afb69/pl/playlist.txt&hash=34141ce7760f58f0c3eb5e0c758afb69
i would like to redirect the link from
http://site-2.com/video/34141ce7760f58f0c3eb5e0c758afb69/pl/playlist.txt
to
http://site-1.com/get.playlist.php?playlist=http://site.com/video/34141ce7760f58f0c3eb5e0c758afb69/pl/playlist.txt&hash=34141ce7760f58f0c3eb5e0c758afb69
That would be something like:
Although that would probably result in an invalid url, you would need to url encode the characters like
:
and/
in the query string.An additional problem is that the redirect is to a different domain, so the url would probably change in the browser address bar.
Is it really on a different domain, as your question title seems to imply otherwise?
If not, you can change it to: