문제

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