2

I have an address: www.domain.com/index.php?category=this-is-me#!

For some reason google directs to this address. I want to redirect my users to www.domain.com/index.php?category=this-is-me

How can I do that? I don't think the "#!" is needed.

I work with htaccess files (php, apache).

Thanks

anubhava
  • 761,203
  • 64
  • 569
  • 643

1 Answers1

0

You can't do anything about it in htaccess files, in php, or in apache. Everything starting from the # is called the URI fragment and it is never sent to the server. So apache doesn't even know it's there.

What you'll need to do is use something that's on the client-side (e.g. browser) to remove it. For javascript, see something like this: Remove fragment in URL with JavaScript w/out causing page reload

Community
  • 1
  • 1
Jon Lin
  • 142,182
  • 29
  • 220
  • 220