htaccess rewrite URL php parameters

后端 未结 2 431
予麋鹿
予麋鹿 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:16

    You don't need to add that to .htaccess, if your URL is inside your Wordpress, you need to add them to the rewrite URL

    Check this: How to create custom URL routes?

    Hope it helps.

    0 讨论(0)
  • 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.

    0 讨论(0)
提交回复
热议问题