Trying to do something i've not done before and i'm failing miserably!
website structure is as follows:
domain.com/collections/ (a directory which displays its index.php with a list of products)
domain.com/biography.php
domain.com/somethingelse.php etc
and in the collections directory i'm trying to get a url like:
domain.com/collections/item
to rewrite as domain.com/collections/index.php?col=item - so i can grab the col $_GET value and display the correct product
At the moment i'm using (in the root directory):
- Code: Select all
Options +FollowSymlinks
RewriteEngine On
RewriteRule ^collections/([^/]+) collections/index.php?col=$1 [NC]
But it's not working - I just get a 404
Is there something wrong with my RewriteRule? Or am I missing something when dealing with a directory like this?
Do i even need to use a directory, or should i just go with a collections.php file, and adjust my Rule to remove the .php and add the /item on the end?
Just a bit confused, help appreciated!
Thanks
James