I have the formation of beautiful URLs using settings .htaccess and rules

RewriteRule ^uiscom/([a-zA-Z0-9_-]+)? /uiscom.php?api_key=$1 [L] 

This forms such a link.

 https://api.site.ru/uiscom/e9a593b1f90b7fb5f88dd838e5e09eff/ 

Where code is the API code to access.

But the problem is that GET data comes from telephony and you need to read them, i.e. after the API key read the parameters that come.

those. the link is:

 https://api.site.ru/uiscom/e9a593b1f90b7fb5f88dd838e5e09eff/?event=incoming_call&start_time=1429796228.8&call_time=2015-04-23+16%3A37%3A08.797&event_timestamp=1429796229&numa=79637501234&numb=74952043093&cdr_id=28008103 

How to read GET parameters?

  • Take the query string from $_SERVER['REQUEST_URI'] and then use the parse_url() and parse_str() functions like this ru.stackoverflow.com/questions/561623/… Or from $_SERVER["QUERY_STRING"] . - Visman
  • @Visman Isn't there a simpler solution? Is it possible to somehow set this in .htaccess so that the link forms with the API key and everything else is read? - Alexander Sizintsev
  • solved the problem, it turns out that instead of the flag L, it was necessary to install QSA - Alexander Sizintsev
  • It is better to make flags [L,QSA] , so that other rules do not work after this. - Visman
  • @Visman Well, yes, I did - Alexander Sizintsev

1 answer 1

found a solution!

If you have beautiful link settings (CNC) made through the RewriteRule rule and there are additional GET parameters that need to be read, then in the rule of forming a beautiful link you just need to put a combination of flags [L, QSA] after the generated link you can display the usual $ _GET.