Remove parameter from URL viac .htaccess

后端 未结 1 993
隐瞒了意图╮
隐瞒了意图╮ 2021-01-23 09:38

I need advice how to remove a parameter from the url using. Htcaccess

The condition is as follows:

redirect url from:

http://example.com/?movie=2&a

相关标签:
1条回答
  • 2021-01-23 10:00

    Try adding the following to the .htaccess file in the root directory of your site.

    RewriteEngine on
    RewriteBase / 
    
    #If request contains ref param
    RewriteCond %{THE_REQUEST} \?([^&\ ]+)&ref=  [NC]  
    #redirect to URL without the ref param
    RewriteRule ^  %{REQUEST_URI}?%1 [L,R=301] 
    
    0 讨论(0)
提交回复
热议问题