Help rewriting url product.php?pid=F-13164&cat=watercraf

Discuss practical ways rearrange URLs using mod_rewrite.

Help rewriting url product.php?pid=F-13164&cat=watercraf

Postby carminejg3 » Fri Apr 29, 2005 3:32 pm

I'm trying to rewrite this url

/motorcycle_accessories/product.php?pid=F-13164&cat=watercraft

into something like.

/motorcycle_accessories/F-13164/watercraft/
or something that would be crawed... and ideas.
carminejg3
 
Posts: 3
Joined: Mon Dec 20, 2004 3:21 pm

Postby Guest » Sat Apr 30, 2005 4:34 am

I'm not great with this, but here is my try:

RewriteRule /motorcycle_accessories/(.*)/(.*) ^/motorcycle_accessories/product.php?pid=$1&cat=$2
Guest
 

Postby Guest » Sat Apr 30, 2005 4:38 am

Opps, I mean:

RewriteRule ^/motorcycle_accessories/(.*)/(.*) /motorcycle_accessories/product.php?pid=$1&cat=$2
Guest
 

Postby carminejg3-1 » Sat Apr 30, 2005 8:17 am

i'll try it out tonight, but I'll check back.... and hey thanks for posting... you did have a better idea then me :-)
carminejg3-1
 

Postby Guest » Sun May 01, 2005 8:30 am

Didn't seem to work?

I posted it in my httpd.conf file, and pointed it to that directory but nothing was rewritten...
Guest
 

Postby Caterham » Mon May 02, 2005 10:20 am

But you did place a 'rewriteEngine On' once per .htaccess?

httpd.conf (per-server context) wrote:RewriteEngine On
RewriteRule ^/motorcycle_accessories/([^/]+)/([^/]+)/?$ /motorcycle_accessories/product.php?pid=$1&cat=$2 [L]




/.htaccess or inside <Directory> (per-dir context) wrote:RewriteEngine On
RewriteRule ^motorcycle_accessories/([^/]+)/([^/]+)/?$ /motorcycle_accessories/product.php?pid=$1&cat=$2 [L]
Caterham
 
Posts: 690
Joined: Fri Dec 10, 2004 1:30 pm

Postby carminejg3-1 » Tue May 03, 2005 12:32 pm

I did have the mod rewrite on

but it didn't seem to work,
carminejg3-1
 


Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 16 guests

cron