URL重写规则

时间:2015-06-05 14:32:38

标签: php .htaccess url mod-rewrite

我有一个关于Simple PHP的小网站,其中不同的文件夹/部分和文件使用不同的参数。

RewriteRule  "^/dummy1/(.*)/(.*)/" "/folder1/file1.php?id1=$1&id2=$2"

RewriteRule  "^/dummy2/(.*)/(.*)/(.*)/" "/folder1/file2.php?id1=$1&id2=$2&id3=$3"

我的尝试

zipmap

请帮帮我

1 个答案:

答案 0 :(得分:1)

尝试:

RewriteRule ^/?dummy1/(.*)/(.*)/?$ /folder1/file1.php?id1=$1&id2=$2 [QSA,NC,L]

RewriteRule ^/?dummy2/(.*)/(.*)/(.*)/?$ /folder1/file2.php?id1=$1&id2=$2&id3=$3 [QSA,NC,L]