301 Redirection to Solve Canonical Issue

Hello Friends –
i created .htaccess file to solve canonical Issue. where i should put in my server. “what is Root ?” i am using godaddy server …

please give me suggestion to solve problem

if any one know correct coding. please tell me my website made in HTML and ASP.net

Hi dallaslane. Welcome to the forums. :slight_smile:

where i should put in my server. “what is Root ?”

The root directory/folder of your site is the main, public container—the folder that contains all your public files—which basically means the folder where your site’s home page is located. An htaccess file that is placed there applies to all pages in the site.

On my server the root is in public_html. Here is the code your looking for. http://www.websitecodetutorials.com/code/htaccess/canonicalization-htaccess-mod_rewrite-301-redirect-non-www-to-www-and-index-to-folder.php

To edit your htaccess just change it to htaccess.txt and edit with notepad. Then change it back to .htaccess before uploading.

Thanks

dk,

Both Ralph and Eric gave answers to your question but they may be moot depending upon:

  1. If you’re using .asp files, there is an Apache module for that but it’s better hosted on a WinDoze server (in the IIS family). Please confirm that you’re using an Apache server as different members of the IIS family treat mod_rewrite quite differently (as M$ is trying to emulate this great Apache module).

  2. Is GoDaddy now allowing you to use mod_rewrite within .htaccess? A few years ago, they had not (and that was only a small part of their reputation as a VERY BAD host - balancing their reputation as a very good domain name registrar).

In any case, you may want to run through the test of both .htaccess and mod_rewrite I have in my signature’s tutorial to be sure it’s available to you.

Regards,

DK