Forum Moderators: phranque
[yourdomain.com:80...]
Is this a possible way of creating a Canonical Issue?
Be glad of any advice
If any part of the URL differers by only one character, then you have a Duplicate Content issue.
It is very easy to 301 redirect such requests to the correct URL, using just two lines of code.
There's many previous posts with such an example, for "appended port numbers and/or punctuation".
Thanks again for the response :)
The first redirects anything that is not exactly the canonical domain (or blank, for HTTP/1.0 requests):
# If requested hostname is not *exactly* "www.example.com" (or blank)
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
# externally redirect to canonical "www.example.com" hostname
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
# If requested hostname is any variation of "example.com"
RewriteCond %{HTTP_HOST} example\.com [NC]
# but is not *exactly* "www.example.com"
RewriteCond %{HTTP_HOST} !^www\.example\.com$
# externally redirect to canonical "www.example.com" hostname
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
#
# If requested hostname is any variation of "ex-maple.com"
RewriteCond %{HTTP_HOST} ex-maple\.com [NC]
# but is not *exactly* "ex-maple.com"
RewriteCond %{HTTP_HOST} !^ex-maple\.com$
# externally redirect to canonical "ex-maple.com" hostname
RewriteRule (.*) http://ex-maple.com/$1 [R=301,L]
Jim
is there a way of rewriting a :80 "request" to "" in Apache?
Thankyou so much I owe you one.
Bilbo :)