<?php generateMenu(); $default = 'home'; //Whatever default page you want to display if the file doesn't exist or you've just arrived to the home page. $page = isset($_GET['p']) ? $_GET['p'] : $default; //Checks if ?p is set, and puts the page in and if not, it goes to the default page. if (!file_exists('inc/'.$page.'.php')) { //Checks if the file doesn't exist $page = $default; //If it doesn't, it'll revert back to the default page //NOTE: Alternatively, you can make up a 404 page, and replace $default with whatever the page name is. Make sure it's still in the inc/ directory. } include('inc/'.$page.'.php'); //And now it's on your page! ?> this is the output of the URL: sitename.com/article/?p=articlename I don't want the ugly '?p=' to be there. I've searched for 'clean url php' and it seems like when I've used something to try and trim that, its over ridden by the PHP used to generate the menu. Do you think .htaccess could trim this off? I know its common to use .htaccess for prettier URL's but I wouldn't want this PHP to get in the way.