Rewriting url (download.php/video.mp4 to download.php)


Rewriting url (download.php/video.mp4 to download.php)

如何重写URL,以便当我的JW播放器通过链接访问文件(http://www.example.com/download.php/video.mp4)它实际上访问http://www.example.com/download.php?

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule download'.php/(.*) /download.php?file=$1 [L,QSA]

这是你需要在web服务器级别配置的东西。

如果你在Apache web服务器上,检查mod_rewrite。http://httpd.apache.org/docs/current/mod/mod_rewrite.html