I've got a CAKEPHP app which has the following rewrite rules in the .htaccess in the webroot folder.
<IfModule mod_rewrite.c>
RewriteEngine On RewriteCond %{HTTP_HOST} !^domain.com$ [NC]
RewriteRule ^(.*)$ domain.com/$1 [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>
I have never worked with CakePHP before and am a PHP beginner, and have written a standalone php script which I have in a folder named 'products' in the webroot folder. My index page in this folder takes in an id and then retrieves the product name and description from the DB. (There are hundreds of products)
So: www.domain.com/products/index.php?id=1
I wish to include a rule where by the URL should look like: www.domain.com/products/the-flux-capacitor
Please can someone tell me how I can achieve this without destroying any of the CakePHP rewrites?
I don't want to risk touching the code in case it all goes crazy
- so back it up first then... – DaveRandom Dec 27 '11 at 22:37