$_SERVER[‘REQUEST_URI_PATH’] = parse_url($_SERVER[‘REQUEST_URI’], PHP_URL_PATH); $segments = explode(‘/’, substr($_SERVER[‘REQUEST_URI_PATH’], 1)); Example: If I wanted a different sidebar for the blog directory in this URL: https://jamesnorthard.com/blog/page/2/ I would use the following code:…
Continue Reading