Getting two variables in the URL with htaccess

后端 未结 3 1366
南旧
南旧 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 14:50

    what's the problem you're having now Seems like Richard got you what you needed?

    Using your example URL:

    http://www.domain.com/adm/generated/pass/6z9c4q9k8p
    

    and the following in your .htaccess

    RewriteRule ^adm/(.*)/(.*)/(.*)$ adm.php?mode=$1&generated=$2&pass=$3
    

    then you can do:

    $mode1 = $_GET['mode'];
    $generated = $_GET['generated'];
    $pass = $_GET['pass'];
    if ( $mode1 == 'generated' && $generated == 'pass' ) 
        echo $pass;
    

    or was that not your question?

提交回复
热议问题