0

I am trying to remove the whole query string from the url using this...

RewriteRule ^/page /page?

But it is not working any reason why this is happening???

Thanks

carlgcode
  • 255
  • 1
  • 6
  • 16
  • hope this will help you http://stackoverflow.com/questions/3457022/mod-rewrite-remove-query-string-from-url – run Sep 12 '11 at 05:23

3 Answers3

0

try using this:

RewriteRule ^page page?
undone
  • 7,857
  • 4
  • 44
  • 69
0
RewriteEngine    On
RewriteCond      %{QUERY_STRING}    ^page$
RewriteRule      (.*)               $1?     [R=permanent]
JimmyB
  • 101
  • 6
0

I suggest you write your rewrite rules like this:

RewriteCond %{QUERY_STRING} !^$
RewriteRule ^page /page? [NC,R,L]

Remember leading slash / is stripped in matching RewriteRule by Apache.

anubhava
  • 761,203
  • 64
  • 569
  • 643