Redirect certain subfolders by removing the parameter question mark

前端 未结 2 734
余生分开走
余生分开走 2021-01-23 07:30

I am using .htaccess to redirect certain subfolders of my domain, to remove the question mark to improve my URLs.

Currently my URLs are like this:



        
2条回答
  •  闹比i
    闹比i (楼主)
    2021-01-23 08:06

    If only changing from query is your requirement then try with below, we are using QSD flag to discard our query string after our rule matched.

    RewriteCond %{QUERY_STRING} ([^\s&]+) [NC]
    RewriteRule ^ /post/%1 [R=302,L,NE,QSD]
    

提交回复
热议问题