Getting two variables in the URL with htaccess

后端 未结 3 1377
南旧
南旧 2020-12-09 14:26

What way it is to be to get two GET methods in the URL by htaccess?

RewriteRule ^adm/(.*)$ adm.php?mode=$1

I\'ve used that for the example

3条回答
  •  感动是毒
    2020-12-09 15:10

    Instead of writing complex regular expressions in the .htaccess, I would just use a simple

    RewriteCond $1 !^adm\.php
    RewriteRule ^adm/(.*)$ adm.php/$1 [L]
    

    and work with $_SERVER['PHP_SELF'] inside adm.php so you can handle any kind of complex URL which starts with adm without changing the .htaccess.

提交回复
热议问题