Php .htaccess重写多个变量

Php .htaccess重写多个变量,php,apache,.htaccess,mod-rewrite,Php,Apache,.htaccess,Mod Rewrite,所以我在我的网站上有一些不同的链接,我正在寻找一些关于如何实现这一点的建议 一些示例链接: domain/index.php?page=commandCenter&ID=40 domain/index.php?page=view&action=edit&ID=40 domain/index.php?page=acpDashboard 我希望每个链接的重写如下所示: domain/commandCenter/40 domain/view/edit/40 domain/ac

所以我在我的网站上有一些不同的链接,我正在寻找一些关于如何实现这一点的建议

一些示例链接:

domain/index.php?page=commandCenter&ID=40
domain/index.php?page=view&action=edit&ID=40
domain/index.php?page=acpDashboard
我希望每个链接的重写如下所示:

domain/commandCenter/40
domain/view/edit/40
domain/acpDashboard
虽然这似乎是为了让它工作,但我需要为这些变量准备一些东西

最后一个链接不起作用,但是

domain/acpDashboard/0/0
这就是它需要工作的地方

这可能吗?我该怎么做?我只有3个不同的变量page、action和ID

这是我的自动取款机

RewriteEngine On
RewriteRule ^([^/]*)/([^/]*)/([^/]*)\.php$ /index.php?    page=$1&action=$2&ID=$3 [L]

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]

谢谢你的建议

你的答案是错误的,你可以参考这个答案

RewriteRule ^([^/]*)/([^/]*)/([^/]*)\.php$ /index.php?page=$1&action=$2&ID=$3 [L]