Simplest URL fails, is HTACCESS wrong?
Posted: Mon Mar 02, 2015 10:15 am
On the contact page, I am trying to take the user to /contact-us&c=y
But if I do, my script that checks if a page exists, says it doesnt, but this is part of contact-us.
But if I do, my script that checks if a page exists, says it doesnt, but this is part of contact-us.
Code: Select all
DirectoryIndex index.php index.html index.htm
order allow,deny
allow from all
RewriteEngine On
Options +FollowSymLinks
Options +Indexes
RewriteRule ^(blog)($|/) - [L]
RewriteRule ^categ/([0-9]+)/([^/]+) /index.php?page=categ&c=$1&cname=$2 [QSA]
RewriteRule ^categ/([0-9]+) /index.php?page=categ&c=$1 [QSA]
RewriteRule ^categ/page/([0-9]+)/([^/]+)/([0-9]+) /index.php?page=categ&c=$1&cname=$2&pagenum=$3 [L]
RewriteRule ^product/([0-9]+)/([^/]+)/([^/]+)/([^/]+) /index.php?page=product&c=$1&category=$2&id=$3&h=$4 [QSA]
RewriteRule ^productsall/([0-9]+)/ /index.php?page=productsall&pagenum=$1/ [L]
RewriteRule ^([^/\.]+)/?$ index.php?page=$1 [QSA]
RewriteRule ^$ index.php?page=home [QSA]Code: Select all
$page= isset($_GET['page']) ? $_GET['page'] : null;
function getPage(PDO $pdo)
{
$thispage="includes/".$_GET['page'].".inc";
if (file_exists($thispage))
{
include $thispage;
}
else
{
echo "<meta http-equiv='Refresh' content='0 ;URL=/'>";
}
}