-2

I have a URL, that in the past. It was accessed as in the example below http://example.com.br/blog but today its as example.com.br.

However, I have external access to queries strings pointing to the folder:

example.com.br/blog/?utm_source=mkt&utm_medium=email&utm_campaign...etc

I want all requests to remove the folder:

example.com.br/?utm_source=mkt&utm_medium=email&utm_campaign...etc

What rules should I create in the .htaccess file?

DᴀʀᴛʜVᴀᴅᴇʀ
  • 7,681
  • 17
  • 73
  • 127
  • http://stackoverflow.com/a/18973073/1183790 – Chris Montanaro Sep 29 '15 at 18:15
  • Can you clarify your expected behavior and include more detail in your example? How are the query parameters relevant to your problem? – kdbanman Sep 29 '15 at 18:54
  • The behavior I want is everything you get in this URL: example.com.br/blog/?utm_source=mkt&utm_medium=email&utm_campaign...etc Be redirected to is example.com.br/?utm_source=mkt&utm_medium=email&utm_campaign...etc All requests that have / blog, the / blog to be removed – Rodrigo Melo Sep 29 '15 at 20:14

1 Answers1

0

You can use:

RewriteEngine on 
RewriteRule ^blog/?$ / [L,NC,R=301]

The query string does not change

Croises
  • 18,570
  • 4
  • 30
  • 47