Originally Posted by
DrByte
You can do it without cPath, but that may cause SEO complications with canonical URLs.
Okay so here's what I have so far:
PHP Code:
if(isset($_GET['ufs'])) {
$ufs = $_GET['ufs'];
// First let's "fix" the search symbol.
// Any sort of %20 and etc are already removed by PHP, so there is no need to run it a second time.
// Let's remove any Underscores (as this will be a valid shortcut such as SPECIAL_X or DS01_20)
$ufs = strtoupper(str_replace("_", " ", $ufs));
$ufs_query = "SELECT ufs.products_id, master_categories_id FROM " . TABLE_CARDS_UFS . " ufs LEFT JOIN " . TABLE_PRODUCTS . " p ON ufs.products_id = p.products_id WHERE collector_no = '" . $ufs . "' LIMIT 1";
$ufs_get_result = $db->Execute($ufs_query);
$ufs_id = $ufs_get_result->fields['products_id'];
$category_id = $ufs_get_result->fields['master_categories_id'];
if($ufs_id && $category_id) {
// Okay we have a valid result... Let's do a redirect.
zen_redirect(zen_href_link("product_cards_ufs_info", 'cPath=' . zen_get_generated_category_path_rev($category_id) . '&products_id=' . $ufs_id, 'NONSSL'), 307);
} else { // We didn't find a valid result... so redirect them to page not found OR homepage.
if (MISSING_PAGE_CHECK == 'On' || MISSING_PAGE_CHECK == 'true') {
zen_redirect(zen_href_link(FILENAME_DEFAULT));
} else if (MISSING_PAGE_CHECK == 'Page Not Found') {
zen_redirect(zen_href_link(FILENAME_PAGE_NOT_FOUND));
}
}
}
(Obviously TABLE_CARDS_UFS is defined in a separate define.)
My problem right now is:
PHP Code:
zen_redirect(zen_href_link(FILENAME_PAGE_NOT_FOUND));
I'm trying to use the redirect code 404 but for some reason when I use:
PHP Code:
zen_redirect(zen_href_link(FILENAME_PAGE_NOT_FOUND), 404);
I get a blank page. Any sugestions?
Bookmarks