0

I need to update a url that at the moment is:

www.examplesite.com/#q=test

to

www.examplesite.com/?q=test

I've try various methods with .htaccess and javascript without success.

Users comes into #q and I need to redirect to ?q

Thanks

wrkman
  • 100
  • 1
  • 12
  • You can't do this because the server doesn't recognize anything after the # sign. You can add it in the substitution part of the rewriterule but not the pattern. – Panama Jack Dec 22 '15 at 18:01

1 Answers1

1

How about using the HTML meta element for redirection?

<html>
<head>
        <meta http-equiv="refresh" content="0; url=http://google.com/?q=hi" />
</head>
</html>

If you would rather use Javascript, you can use:
location.href = "http://www.google.com/?q=hi";

YishaiG
  • 99
  • 8
  • Hey, thank you for you answer. The problem is that i need to refresh the page by keep the variable in q parameter. So this unfortunately can't help. – wrkman Dec 22 '15 at 15:24
  • I'm not sure I understood you, but if you want to use JS to get the current hashtag value, you can use `window.location.hash` – YishaiG Dec 23 '15 at 18:05