my categories and regions get mangled by google only

Discuss practical ways rearrange URLs using mod_rewrite.

my categories and regions get mangled by google only

Postby rudyten » Thu Jun 12, 2008 12:07 pm

and i am not sure why?

format is: categories followed by locations
/cat/cat1/cat2/cat3/reg/loc1/loc2/loc3

So these are valid:
www.example.com/cat/crafts.html
www.example.com/cat/crafts/reg/united-states.html
www.example.com/cat/crafts/beading/reg/ ... ornia.html

-------------
now and then i see these on my logs.. THESE ARE BAD, beading is in location
www.example.com/cat/crafts/reg/united-s ... ading.html
www.example.com/cat/crafts/beading/reg/ ... ading.html

A category added to the location area.

my REWRITE
RewriteRule ^cat/[-a-z0-9_]+(?:/[-a-z0-9_]+)*?(\.html|/)?$ /list.php?cat=$0 [NC,QSA,L]

I then break if down in script
rudyten
 
Posts: 37
Joined: Wed Nov 17, 2004 8:57 am

Postby richardk » Fri Jun 13, 2008 2:24 pm

Have you made sure you don't have any bad URLs in your site and are not linked to by people with the wrong URL? Mod_rewrite only matches what you pass to it.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: Majestic-12 [Bot] and 47 guests

cron