Forum Moderators: phranque

Message Too Old, No Replies

combining canonicalization and SEF solutions

is there a nicer solution

         

smithydude

1:41 pm on Apr 27, 2009 (gmt 0)

10+ Year Member



My canonicalization rule in the root .htaccess is as follows:

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.example\.co\.uk$
RewriteRule ^(.*)$ [www....] example.co.uk/$1 [R=301,L]

Then in the "find" folder I have the following rules to enable a large number of SEF pages

RewriteEngine on
RewriteRule ^([-a-zA-Z]+)/$ /find/view.php?code=$1 [L]
RewriteRule ^([-a-zA-Z]+)/([-a-zA-Z]+)/$ /find/view.php?code=$1&loc=$2 [L]

The canonicalization works find for all the site except for pages like "example.co.uk/find/roses/london/" which do not get redirected to the "www" equivolent as I would like.

Anyone know the solution here? Any help much appreciated!

jdMorgan

3:09 pm on Apr 27, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



See RewriteOptions inherit in the Apache mod_rewrie docs.

Jim