0

I am using this to get my current url.

https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]

But it is not returning character after #. I have my url like this

https://example.com/category/post/#loc

and with this code i am getting only

https://example.com/category/post/

How i can get a complete url?

wplearner
  • 405
  • 6
  • 19
  • 6
    The `#` part, the anchor, is not sent as part of the request and is invisible to the server, it's purely a client-side notation used for positioning the page or, recently, preserving client-side state. – tadman Nov 07 '17 at 19:17
  • 1
    As tadman said. You have to use Javascript on the requested page to find whatever is after the `#`, then either query for the correct content or redirect to another page. – JMichelB Nov 07 '17 at 19:18
  • Ok Thank you for your time. I am clear about it now. – wplearner Nov 07 '17 at 19:20

0 Answers0