Computers |
|
| | #1 (permalink) |
| Newb Techie Join Date: Nov 2006
Posts: 27
| Ok guys. Need some help with this. I have URLs like the following: index.php?id=page page is page.php I have it so bare pages are included with php into the index.php, which then has the css there so the page looks normal index.php: Code: <?PHP
$id = $_GET['id']; if (!isset($id)) { $id = 'home'; }
if (strstr($id,'/')) { $id = 'no'; }
if (!file_exists($id . '.php')) {
echo('404 ' . $id . '.php could not be found!');
}
else {
include($id . '.php');
}
?> Code: RewriteEngine on RewriteRule ^id/([^/\.]+)/?$ index.php?id=$1 [L] So, without putting all the code on each content page, how would I get this working correctly? |
| | |