TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   General (http://www.talkphp.com/general/)
-   -   need some mod_rewrite help (http://www.talkphp.com/general/3465-need-some-mod_rewrite-help.html)

sarmenhb 10-10-2008 12:11 AM

need some mod_rewrite help
 
i read a few tutorials on mod_rewrite but im still stumped.

what i'm wondering is if i have something like this

Code:

cart.php?m=product_list&c=7
how would i write this? to put like /products/the-products-name (where 7 is the products title)

this is what i've tried so far

Code:

RewriteEngine On
^products$/the-products-name cart.php?m=product_list&c=$1

ps: another thing that confuses me is once i have written the rules in .htaccess will the rules automatically take effect? or do i have to go back to the code and rewrite all the links such as wherever it calls ?m=product_list&c i have to rewrite it with /products/$tblrow ? i just hope its not like that but let me know :) thanks alot

jcorradino 10-10-2008 06:28 AM

try this

Code:

RewriteEngine On
RewriteRule products/(.*)/(.*) /cart.php?m=$1&c=$2

this way, it would be something along the lines of http://www.yoururl.com/products/Product-List/Blue-Widget

hope this helps,


All times are GMT. The time now is 11:51 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0