Forum Moderators: phranque
To do that I just added this:But who will request the forms with / if there's no redirect in place?
RewriteRule ^(north|south)-(\w+)-(.+) http://www.example.com/$1/$2/$3 [R=301,L]
or
RewriteRule ^north/baccarat/(.*)$ https://www.example.com/north/baccarat/$1 [L]
RewriteRule ^south/baccarat/(.*)$ https://www.example.com/south/baccarat/$1 [L]
RewriteRule ^north/bridge/(.*)$ https://www.example.com/north/bridge/$1 [L]
RewriteRule ^north/baccarat/(.*)$ /php/namesearch.php?location=north&game=baccarat&person=$1 [L]
RewriteRule ^south/baccarat/(.*)$ /php/namesearch.php?location=south&game=baccarat&person=$1 [L]
RewriteRule ^north/bridge/(.*)$ /php/namesearch.php?location=north&game=bridge&person=$1 [L]
But who will request the forms with / if there's no redirect in place?
RewriteRule ^(north|south)-(\w+)-(.+) http://www.example.com/$1/$2/$3 [R=301,L]
you want an external redirect with a 301 status code.
Ok, with Phranque's suggestion I now have:
RewriteRule ^north/baccarat/(.*)$ https://www.example.com/north/baccarat/$1 [L]
RewriteRule ^south/baccarat/(.*)$ https://www.example.com/south/baccarat/$1 [L]
RewriteRule ^north/bridge/(.*)$ https://www.example.com/north/bridge/$1 [L]
RewriteRule ^north/baccarat/(.*)$ /php/namesearch.php?location=north&game=baccarat&person=$1 [L]
RewriteRule ^south/baccarat/(.*)$ /php/namesearch.php?location=south&game=baccarat&person=$1 [L]
RewriteRule ^north/bridge/(.*)$ /php/namesearch.php?location=north&game=bridge&person=$1 [L]
That is working as required.
...the search engines still have the old location-game-person and I think I will be getting duplicates for this.
So should I now have a rewrite for the dashes to slashes?
example.com/location-game-person
to
example.com/location/game/person
RewriteRule ^(north|south)/(baccarat|bridge)/(.*)$ /php/namesearch.php?location=$1&game=$2&person=$3 [L]
Performance metrics on this scale are so narrow that you might as well use whatever form you, personally, are most comfortable with. Since you’ve got a series of mutually exclusive rules, each with an [L] flag, try to list them in order of most-likely-to-succeed: If more people play north than south (but, but, what about east and west?) then put the ^north rules first, and similarly if bridge is more popular than baccarat, put the bridge rules first.