I found out that $_SERVER[‘PHP_SELF’] and $_SERVER[‘REQUEST_URI’] are coming very near to what I am looking for. Only not completely. This is the situation: I am working on a Multi-lingual Website, where each language is located in its own directory e.a. en, it, es, nl etc… So when I’m on the english version (en/index.php) of the site and I click the Italian flag, I should be redirected to index.php in the Italian directory (it/index.php) so I tried: