[英].htaccess rewrite for multiple variables
因此,我在网站上有一些其他链接,我正在寻找有关如何实现此目标的建议。
一些示例链接:
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个不同的变量页面,操作和ID。
这是我的htaccess atm!
RewriteEngine On
RewriteRule ^([^/]*)/([^/]*)/([^/]*)\.php$ /index.php? page=$1&action=$2&ID=$3 [L]
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
感谢您的任何建议!
您的这里是错误的,您可以参考.htaccess RewriteRule来保存GET URL参数此答案
RewriteRule ^([^/]*)/([^/]*)/([^/]*)\.php$ /index.php?page=$1&action=$2&ID=$3 [L]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.