I have a number of links which has an ID dynamically appended to the href from the database i.e
index.php/product/{id} - the browser see's index.php/product/3 for instance.
OK I have a views file that needs to grab the ID from the URI in order to make a query relevant to the ID. Every time I visit index.php/product/3<-------a number(id)
I get a 404. How can I stop this
Thanks
Comments
Then add the following to it:
$pages['product|product/:any'] = array('view' => 'product');
This tells FUEL to map requests from anything at "product" to the fuel/application/views/product.php view file.
Also, this page isn't being served up by a controller and there are no routes in place that may be causing an issue right?
I have a product page in the CMS with no body which uses a layout of product, in the product layout its loading the viewfiles header | product view code | footer etc
I would have a products view page where using the ID/URI Segment it would then query the database with the current product ID. Pretty simple stuff, the URI product will open up fine its just the URI thats failing me, when I navigate to anything past product/i.e a id number of which I need its returning 404.
The page title once navigated to the URL is 404 Error : Page Cannot be found.
<?
// this is my product.php in _variables
$pages['product|product/:num'] = array('view' => 'product');
?>
Thanks
also how im calling it
http://www.website.co.uk/shop/index.php/product/2