0

i am trying to add a rule to my .htaccess file to remove a slash in front of any query string. An URL like https://www.someDomain.com/someText/anotherText/?bp=someNumber should be rewritten to URL https://www.someDomain.com/someText/anotherText?bp=someNumber so there must be no slash in front of the question mark.

Thx

Haggis
  • 1
  • 1

1 Answers1

0

You can use:

RewriteEngine on
RewriteCond %{QUERY_STRING} ^.+$
RewriteRule ^(.*)/$ $1 [L,R=301]

For redirection with code 301

Croises
  • 18,570
  • 4
  • 30
  • 47
  • Thanks a lot. Your rule inserts the local path so i changed it to RewriteRule ^(.*)/$ /$1 [L,R=301] which is working fine. – Haggis Aug 28 '15 at 06:09