0

我要重写网址

http://site.com/videoplayback?pkey=05131305222303&hkey=a7432d324546a9b2c24abb4e81a26e67&tkey=l4i5w5s444&fkey=05131305222303.mp4

http://site.com/videoplayback/051313052223030/a7432d324546a9b2c24abb4e81a26e67/l4i5w5s444/05131305222303.mp4

我的 htaccess

RewriteRule ^videoplayback/(.*)/(.*)/(.*)/(.*)$ videoplayback?pkey=$1&hkey=$2&tkey=$3&fkey=$4 [L]

但是当我尝试访问此 url 时总是出现错误 404

http://site.com/videoplayback/051313052223030/a7432d324546a9b2c24abb4e81a26e67/l4i5w5s444/05131305222303.mp4
4

1 回答 1

2

这对我有用:

RewriteRule ^videoplayback/([^/]+)/([^/]+)/([^/]+)/([^/]+).mp4$ /videoplayback?pkey=$1&hkey=$2&tkey=$3&fkey=$4 [L]

进行了三处更改(有些可能不需要)

  1. 在规则末尾添加 .mp4
  2. 在重定向的开头添加了斜杠
  3. 将 .* 更改为 [^/]+ 以保持理智
于 2013-05-15T17:41:59.010 回答