Support » Fixing WordPress » Where I am in the site? parsing http_request

  • Resolved


    Hi… does someone know where wordpress parses the http_request of the client?

    I’d like to have the first “folder”, for example if my website is and a client is on I want the “blog” string.

    Actually to know where I am I do a very complicate if-else block with categories and pages tag-functions, but honestly I think it’s a loss of server-memory…

    Otherwise, I need to know how to get the CATEGORY/MOTHER_PAGE I’m in, without using stupid recursive functions.

Viewing 4 replies - 1 through 4 (of 4 total)
  • If all you’re trying to figure out is what is in the user’s address bar, you don’t need a WP function. PHP will do that for you. Try one of these variables. If the user visits ‘’ then…

    $_SERVER["REDIRECT_URL"] == '/blog/folder';
    $_SERVER["REQUEST_URI"] == '/blog/folder?p=3';
    $_SERVER["HTTP_HOST"] == '';

    Take your pick.

    Yes, I knew, but I suppose that WP parses that somewere…

    My intention was to not parse it again… with the risk of doing errors e/o using useless server resources.

    Is there another solution?

    Ahh. If I’m understanding you correctly, I think you’ll find your answer here:


    Thank you 😉


Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Where I am in the site? parsing http_request’ is closed to new replies.