Link to home
Start Free TrialLog in
Avatar of bleggee
bleggeeFlag for United States of America

asked on

Coding of .htaccess for canonical issue & robots.txt for sitemap

Can someone check this please ... Is this the correct coding for robots.txt if I put a sitemap.xml file in the web root folder:
     User-agent: *
     https://EXAMPLE.COM/sitemap.xml
and
Is this the correct coding for .htaccess if I want to direct all requests to the Non-www https version of a URL:
     RewriteEngine On
     RewriteCond %{HTTP_HOST} ^www\.EXAMPLE\.com [NC]
     RewriteRule ^(.*)$ https://EXAMPLE.com/$1 [L,R=301]
     RewriteCond %{SERVER_PORT} 80
     RewriteRule ^(.*)$ https://EXAMPLE.com/$1 [L,R=301]
Any advice appreciated!
ASKER CERTIFIED SOLUTION
Avatar of Steve Bink
Steve Bink
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial