forum avatar

How to resolve canonical Issue If site is hosted on Windows Server?

By
Published 4th February 2011 |
Read latest comment - 2nd June 2011

Hi all
As I know that canonical issue can be resolve by editing .htaccess file if site is hosted on Unix server.
How can we resolve canonical issue if my site is hosted on Windows Server?

Thanks
lucintel.com
Comments
301 Redirect Code :: How To Configure a 301 Permanent Redirect, htaccess, ASP, Windows

Steve Richardson
Gaffer of My Local Services
My Local Services | Me on LinkedIn

forum avatarPollyannaMcAleer
2nd June 2011 11:56 AM
How to solve canonical issues: We can solve this issue by redirecting all these URLs to a single URL permanently. By uploading a .htaccess file we can easily redirect all the URLs.

1: Following is the code to redirect non www domain (yoursite.com/) to www domain (yoursite.com/) permanently (301):


Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yoursite.com
RewriteRule ^(.*)$ yoursite.com/$1 [R=permanent,L]


2: Following code is to redirect index.html to yoursite.com/


RewriteCond %{THE_REQUEST} ^[A-Z]{3,9} /.*index.html HTTP/
RewriteRule ^(.*)index.html$ /$1 [R=301,L]

3: Following code is to redirect index.php to yoursite.com/


RewriteCond %{THE_REQUEST} ^[A-Z]{3,9} /.*folder/index.php HTTP/
RewriteRule ^(.*)folder/index.php$ /folder/$1 [R=301,L]

After creating the .htaccess file we just need to upload it to the root folder of the website.

Thanks for the suggestion. I need ti check first its really work are not.

proval123

This Thread is now closed for comments