Question

Want to redirect /dl/[dlcode]/[cleanname].mp4 to /dl/cache/[dlcode].mp4

Got AllowOverride All in the apache2 config file then the following in the document root .htaccess,

RewriteEngine on
RewriteRule ^dl/([^/]+)/([^/]+)\.mp4$ /dl/cache/$1.mp4 [NC]

I've been trying it with files that def exist. Both the [dlcode] and [cleanname] just contain a-zA-Z0-9 characters

Cheers for any help!

Was it helpful?

Solution

In some cases you need to add a leading slash:

RewriteRule ^/dl/([^/]+)/([^/]+)\.mp4$ /dl/cache/$1.mp4 [NC]
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top