Вопрос

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!

Это было полезно?

Решение

In some cases you need to add a leading slash:

RewriteRule ^/dl/([^/]+)/([^/]+)\.mp4$ /dl/cache/$1.mp4 [NC]
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top