I get the url of the page on which I am using the following function:

function getUrl() { $url = @( $_SERVER["HTTPS"] != 'on' ) ? 'http://'.$_SERVER["SERVER_NAME"] : 'https://'.$_SERVER["SERVER_NAME"]; $url .= ( $_SERVER["SERVER_PORT"] != 80 ) ? ":".$_SERVER["SERVER_PORT"] : ""; $url .= $_SERVER["REQUEST_URI"]; return $url; } 

enter image description here

In the browser row, the link is CNC, below without a cnc, which the above function returns to me

But it defines the url without a cnc, how to get the url of the page on which I am already with CNC?

  • if "it defines a url without a cnc", then the CNC is not implemented correctly. in $ _SERVER ["REQUEST_URI"] there should be a cnc query - Ipatiev
  • @ Ipatiev is a standard CNC in the shopscript engine, robots perceive it normally. It is somehow unreasonable to rework the CNC from scratch) can there be any crutches to solve the problem? - sbaikov
  • one
    And here robots? Do they get you into the code? If the Krivoruk authors of this script rewrite REQUEST_URI, try searching $ _SERVER in other elements. - Ipatiev

0