【发布时间】:2015-03-21 09:46:00
【问题描述】:
我怎样才能使两种重写都像http://example.com/something.html http://example.com/videos/something/1.html 一样工作,它始终与download.php 匹配,但与video.php 不匹配。
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
RewriteBase /
RewriteRule ^category/(.+)$ category.php?q=$1
RewriteRule ^videos/(.+)/(.+).html$ video.php?q=$1&page=$2
RewriteRule ^(.+).html$ download.php?id=$1
【问题讨论】:
标签: php regex .htaccess mod-rewrite