7.3. Passing URL Values to admin.php with .htaccess

As your application stands right now, the URLs in your administrative links won't mean anything to admin.php. To remedy this, you need to modify .htaccess with an additional rule that handles URLs passed in a link to admin.php.

7.3.1. Modifying the Original Admin Rule

When you write this rule, you need to keep in mind that new entries are passed to admin.php without a URL, so you need to allow for scenarios where a URL is passed to admin.php, as well as for scenarios where it isn't. To do this, you'll modify your original admin rule to ensure that the path ends with the page name, followed by either a forward slash or nothing at all. With these modifications, your rule in .htaccess should ...

Get PHP for Absolute Beginners now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.