I am using a PHP CMS that I've made myself. It fetches the $_GET parameter url and turns it into www.website.com/{url}. This CMS uses the $_GET parameter to get the file. So, if the url is index, then the CMS searches for the file index and returns the contents of the file. But now, I'm expanding the CMS to have an addition parameter like profile/{username}. How can I expand on it? I want my URL to say www.website.com/profile/{username}. How would I go about doing this? This is my current htaccess:
RewriteEngine On
RewriteRule ^(|/)$ index.php?url=$1
RewriteRule ^([a-zA-Z0-9_-]+)(|/)$ index.php?url=$1a
Here is the TPL system.
public function addTpl() {
global $zip;
if(!isset($_GET['url']) || empty($_GET['url'])) {
$_GET['url'] = 'index';
}
if(file_exists('_zip/_templates/_front/'. $zip['Template']['Front'] . '/')) {
if(file_exists('_zip/_templates/_front/'. $zip['Template']['Front'] . '/' . secure($_GET['url']) . '.php')) {
ob_start();
include('_zip/_templates/_front/'. $zip['Template']['Front'] . '/' . secure($_GET['url']) . '.php');
$this->tpl .= ob_get_contents();
ob_end_clean();
} else {
die(zipError('File Not Found', 'The file <b>' . secure($_GET['url']) . '</b> could not be found. Please re-check the URL; If you were directed here using a link, please report that link.'));
}
} else {
die(zipError('Template Not Found', 'The template <b>' . $zip['Template']['Front'] . '</b> could not be found. Please check your configuration file for a mistake.'));
}
}
Is there any other information I need to provide? I need to get this done ASAP, so any advice would be greatly appreciated.