1

Is there any way to remove # from a URL?

I know how to remove query strings using this:

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^?]*)\?
RewriteRule (.*) /$1? [R=301,L]

But is there also any way to remove # from the URL? (Example.com/#removethis)

MrWhite
  • 43,179
  • 8
  • 60
  • 84
  • Do these help answer your question? [Removing '#' from URL using htaccess](https://stackoverflow.com/a/41454241/924299), [URL rewriting removing hash](https://stackoverflow.com/questions/1991626/url-rewriting-removing-hash), and [How do you remove anchor tags from URL?](https://stackoverflow.com/questions/20198731/how-do-you-remove-anchor-tags-from-url) – showdev Feb 13 '21 at 05:24

1 Answers1

2

No.

The fragment portion of an HTTP URL is handled entirely client-side. It is never sent to the server. Since the server can't know about it, it can't do anything about it.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335