Pergunta

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!

Foi útil?

Solução

In some cases you need to add a leading slash:

RewriteRule ^/dl/([^/]+)/([^/]+)\.mp4$ /dl/cache/$1.mp4 [NC]
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top