使用htaccess和虚拟子文件夹重写URL

时间:2012-03-31 15:21:25

标签: php .htaccess mod-rewrite

我在htaccess中有这个

RewriteEngine On
RewriteRule ^records$ records.php [L]
RewriteRule ^records/$ records.php [L]
RewriteRule ^records/pro$ records_pro.php [L]
RewriteRule ^records/pro/$ records_pro.php [L]
Rewriterule ^records/pro/player/(.*?).html$ records_mpro.php?name=$1 [L]
Rewriterule ^records/pro/map/(.*?).html$ records_mapro.php?map=$1 [L]
RewriteRule ^records/pro/totales$ records_qpro.php [L]
RewriteRule ^records/pro/totales/$ records_qpro.php [L]

/records/records/重写

外,一切正常

有什么想法吗?我不能让它发挥作用

1 个答案:

答案 0 :(得分:1)

请试试这个。并确保records.phphtaccess

的目录相同
RewriteEngine On

Rewriterule ^records/pro/player/(.*?).html$ records_mpro.php?name=$1 [L]
Rewriterule ^records/pro/map/(.*?).html$ records_mapro.php?map=$1 [L]
RewriteRule ^records/pro/totales(/?)$ records_qpro.php [L]
RewriteRule ^records/pro(/?)$ records_pro.php [L]
RewriteRule ^records(/?)$ records.php [L]