htaccess rewrite URL php parameters

后端 未结 2 437
予麋鹿
予麋鹿 2021-01-21 23:28

I am trying to rewrite a specific PHP file GET parameter but cant seem to get things to work.

I want to rewrite http://www.example.com/meeting.php?ref=y0fpjXrrGP

2条回答
  •  无人共我
    2021-01-22 00:17

    Just use this in your .htaccess file:

    RewriteEngine On
    RewriteRule ^meeting/([^/]*)$ /meeting.php?ref=$1 [L]
    

    It will leave you with the URL: http://www.example.com/meeting/y0fpjXrrGP

    Make sure you clear your cache when testing this.

提交回复
热议问题