If you have a collection of rewrites and redirects to implement, you are better off using directives all from the same Apache module so that you can control the order in which they are parsed. Using RewriteCond and RewriteRule often allows greater flexibility of implementation, and of course does allow both redrects and rewrites to be implemented together.
You don't want to expose the workings of internal rewrites by having them run before any associated redirects. That can occur if they are coded using directives from different modules.
Domain canonicalisation is the first step. You also need to ensure that all internal links point to the correct version too. Visiitors browsing the site should not pass through any redirects when clicking internal navigation links.
Once you get started, you'll see many other uses for these directives and their close relatives.
One word of warning when uploading the .htaccess file. Most FTP programs hide filenames that begin with a dot. Make sure you edit that option, so you can see if there is a .htaccess file on the server already. If there is, then download that and edit it. Don't just overwrite the existing file, as you will lose all the settings that were already contained within it.
Reply
Grow Your Business with Effective Website Design and SEO
Use experience and skills of a reliable SEO and a web designer I trust to get more sales from your website.
Great Web Design and SEO Services
Use experience and skills of a reliable SEO and a web designer I trust to get more sales from your website.
.htaccess
If you have a collection of rewrites and redirects to implement, you are better off using directives all from the same Apache module so that you can control the order in which they are parsed. Using RewriteCond and RewriteRule often allows greater flexibility of implementation, and of course does allow both redrects and rewrites to be implemented together.
You don't want to expose the workings of internal rewrites by having them run before any associated redirects. That can occur if they are coded using directives from different modules.
Domain canonicalisation is the first step. You also need to ensure that all internal links point to the correct version too. Visiitors browsing the site should not pass through any redirects when clicking internal navigation links.
Once you get started, you'll see many other uses for these directives and their close relatives.
One word of warning when uploading the .htaccess file. Most FTP programs hide filenames that begin with a dot. Make sure you edit that option, so you can see if there is a .htaccess file on the server already. If there is, then download that and edit it. Don't just overwrite the existing file, as you will lose all the settings that were already contained within it.