Say you have
http://example.com/drupal/documentation?page=1. Let's presume
documentation is an alias for
Then after a full bootstrap
Note that base_path() is a one line wrapper for returning the global $base_path and similarly current_path() just returns $_GET['q']. Unlike in previous versions of Drupal, the 'q' variable is not loaded by .htaccess but computed during bootstrap and so the old method of reading $_REQUEST['q'] for the original path does not work in Drupal 7, use request_path() instead.
Pay attention to slashes on the bases: base_url never has a slash at the end while base_path always has one.
Finally note that before the full bootstrap (hook_boot, cache backends and other early plugins) the current_path() function doesn't exist and $_GET['q'] is still 'documentation'. The rest is set up extremely early so those can be relied upon.
Commenting on this Story is closed.