douyiken0968 2013-05-15 15:57
浏览 24
已采纳

视频文件htaccess的URL重写

I want rewrite url

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

to

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

My htaccess

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

But always have error 404 when i try access to this url

http://site.com/videoplayback/051313052223030/a7432d324546a9b2c24abb4e81a26e67/l4i5w5s444/05131305222303.mp4
  • 写回答

1条回答 默认 最新

  • drti52047 2013-05-15 17:41
    关注

    This works for me:

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

    Made three changes (some may not be required)

    1. Added .mp4 to the end of the rule
    2. Added slash to the beginning of the redirect
    3. Changed .* to [^/]+ for sanity
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 vhdl+MODELSIM
  • ¥20 simulink中怎么使用solve函数?
  • ¥30 dspbuilder中使用signalcompiler时报错Error during compilation: Fitter failed,求解决办法
  • ¥15 gwas 分析-数据质控之过滤稀有突变中出现的问题
  • ¥15 没有注册类 (异常来自 HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
  • ¥15 知识蒸馏实战博客问题
  • ¥15 用PLC设计纸袋糊底机送料系统
  • ¥15 simulink仿真中dtc控制永磁同步电机如何控制开关频率
  • ¥15 用C语言输入方程怎么
  • ¥15 网站显示不安全连接问题