The page contains multiple canonical formats.

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 4
Joined: 18 Feb 2013, 20:42

The page contains multiple canonical formats.

01 May 2013, 11:48

How to resolve the issue of "The page contains multiple canonical formats." using url rewrite.

I have used the url rewrite filter to make url user and seo friendly, but i come to know that google and bing don't like if same page access by different urls.

here is the multiple URL

1) http://www.14gaam.com/hindu-wedding-ceremony.htm
2) http://www.14gaam.com/parse.asp?ParseName=hindu-wedding-ceremony

Here is the script for URL rewrite.

RewriteCond Host:http://www.14gaam.co ^m$
RewriteRule ^/(.*)\.htm$ /parse.asp?ParseName=$1

What happen behind the scene.

When ever any user make request of page (eg hindu-wedding-ceremony.htm) It's check into url rewrite
and pass to the parse.asp as query string $1 (hindu-wedding-ceremony) and result the page without modifying URL

but even if you try to access page with URL (http://www.14gaam.com/parse.asp?ParseName=hindu-wedding-ceremony),
It is still accessible. What is the solution of it.

Thanks,

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: The page contains multiple canonical formats.

01 May 2013, 18:06

Hello,

It seems like you did the first part of the job - rewrite, but now you need a 301-redirect back.
However, tell me first, what is your version of ISAPI_Rewrite? 2 or 3? The rule you provided looks more like 3.

Regards
Andrew

User avatar
Posts: 4
Joined: 18 Feb 2013, 20:42

Re: The page contains multiple canonical formats.

15 May 2013, 15:51

sorry for too late reply. :(

I can see the version i am using is 3.1.0.98.

below it the code for URL rewrite can help you understand the scenario.

Thanks,


# Helicon ISAPI_Rewrite configuration file
# Version 3.1.0.98

RewriteEngine On
RewriteCompatibility2 On
RepeatLimit 200
RewriteBase

# ## 14gaam.com ####

RewriteCond %{HTTP:Host} ^(14gaam\.com)$ [NC]
RewriteCond %{REQUEST_URI} (.+)
RewriteRule .? http://www.%1%2 [NC,R=301,L]

RewriteCond Host:http://www.14gaam.co ^m$
RewriteRule ^/(.*)\.htm$ /parse.asp?ParseName=$1

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: The page contains multiple canonical formats.

20 May 2013, 09:17

Hello,

The condition doesn't look good to me. Lets try to edit the existing rule and add a new rule:

Code: Select all
RewriteCond %{HTTP:Host} ^www\.14gaam\.com$
RewriteRule ^/([^.]+)\.htm$ /parse.asp?ParseName=$1 [NC,L]

RewriteCond %{HTTP:Host} ^www\.14gaam\.com$
RewriteCond %{QUERY_STRING} ^ParseName=(.+) [NC]
RewriteRule ^parse\.asp /%1.htm [NC,R=301,L]


Regards
Andrew

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 20 guests