How can I detect '#!' in a url?

1

I would like to be able to use these symbols #!data in my urls and get the text after the symbols to send it by PHP and do a search. I would like to implement this method with .htaccess and I would like to know how to do it. Thanks in advance.

    
asked by Eddy Otsutsuki 18.02.2017 в 23:52
source

2 answers

2

It is not possible , since tags (or snippets - everything after # ) are never sent to the server. Instead, they are managed by the customer.

An alternative is to obtain it with JavaScript, once the resource has been accessed. That is, when the page has already been loaded.

In JavaScript you get with window.location.hash .

    
answered by 19.02.2017 / 00:40
source
-1

I recommend this link

In your case it would be

RewriteEngine on

RewriteRule ^buscar/(.*)$ buscador.php?data=$1

Then you put link and you're done.

    
answered by 19.02.2017 в 00:39