Home Using .htaccess to rewrite a file with extension
Reply: 0

Using .htaccess to rewrite a file with extension

JROB
1#
JROB Published in 2017-11-11 18:18:18Z

I am trying to create an htaccess rule that will allow a URL like this:

example.com/some/random/file.mp3

To point to:

example.com?track.php?file=some/random/file.mp3

So I have:

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /track.php?file=$1 [QSA]

...and for those of you who know what you're doing, you will know quite quickly that this is not working.

Could someone help me get this rule written correctly?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.339121 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO