If you did not pay attention, you can have all your pages with two different urls: www.example.com/page.htm and example.com/page.htm. For your home page it can be up to four different urls. Do not panic, there are easy solutions.
Force the www form
To avoid duplicate content between www.example.com and example.com, force the usage of www.example.com with an htaccess file installed at the root of your hosting, with the following content.
Replace example.com with the url of your site. If there is already an htaccess file in place, just copy the lines inside the existing file.
Force the home page url
To avoid duplicate content between www.example.com and www.example.com/index.php, force the short url with a small php block placed at the beginning of the index.php page.
Check the result
After the change, request both forms of the address in your browser. The first one should answer with a permanent redirect to the second, and the address bar should end on the form you decided to keep. CrawlTrack will show you the crawler visits on the final url only, which makes the numbers much easier to read.
Redirect references
Sources and further reading, all outside this site. They open in a new context and are listed for reference only.
- Apache mod rewrite the directives used above
- Apache redirect how to worked rewrite examples
- Google canonical guidance how search engines treat duplicates
- CrawlProtect htaccess builder the companion script that writes a full htaccess for you
- HTTP 301 redirect what the rule returns
- mod_alias an alternative to rewriting
- htaccess files scope of the file
- Let's Encrypt https for the final address
- SSL Labs test the https setup