Forum Moderators: phranque
Due to a bit of bad planning, we've recently changes some of our URL schemes.
We used to have
[domain.com...]
[domain.com...]
[domain.com...]
Now we're dropping the postcode to make the URLs more friendly
[domain.com...]
[domain.com...]
[domain.com...]
However, I'm sure you can see that our old URL will clash with the new.
the main concern is that any published links for
[domain.com...]
will try to push through to the new venue page
As the postcode is a specific format, I'm trying to place a rewrite rule infront of the venue rewrite rule to catch the old URLs
We need to match postcodes such as:
M1
M26
L1
SW1
SW1A
My current rule is:
RewriteRule ^whats-on/([^/]+)/[A-Za-z][A-Za-z]?[0-9][0-9]?[A-Za-z]?/$ /keyword/$1/ [L,R=301]
Quite complex, any way to improve upon this?
RewriteRule ^whats-on/([^/]+)/[a-z]{1,2}[0-9]{1,2}[a-z]?/(.*)$ /keyword/$1/$2 [NC,R=301,L]