View Single Post
Old 03-24-2010, 10:51 AM   PM User | #1
bonkerz
New to the CF scene

 
Join Date: Mar 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
bonkerz is an unknown quantity at this point
Question Weird htaccess rewrite problem

I've taken over management of a corporate website, and it has built in RewriteRules to display products.

So http://www.mywebsite.com/product-1 displays product 1, however the page "product-1" doesn't actually exist.

On top of this, if I went to http://www.mywebsite.com/whateveriput/product-1, the product 1 page would STILL be displayed.

And on top of this, if I put in a fictional page after the domain, such as http://www.mywebsite.com/testing123455, it does not return a 404, instead it displays a page called "products.php" ....

I've had a look at the htaccess and this is whats in it :

Code:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ products.php?$1 [L]
Now, I'm no htaccess expert, but this rule seems a BIT open ended! i.e ANYTHING, that isnt a file or a directory gets rewritten via products.php? Is this right? What could I do to make it less open ended?

Anyway, so I delete this htaccess, and now my products don't work with their rewritten URLS (obviously). So to access them, I would think that all you would have to do is type :

http://www.mywebsite.com/products.php?product-1

and the product would be displayed? However it doesn't...

So how do I find out how to get to my products without the htaccess? I am well confuzzled...

bonkerz is offline   Reply With Quote