Domanda

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!

È stato utile?

Soluzione

In some cases you need to add a leading slash:

RewriteRule ^/dl/([^/]+)/([^/]+)\.mp4$ /dl/cache/$1.mp4 [NC]
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top