Forum Moderators: phranque
^(www\.example\.com)?$ It appears that every single little punctuation mark makes or breaks the codeYes. This is server configuration code. A single misplaced full stop could put your site offline and out of business.
if this is 100% correctIt is if you want to 301 redirect all other domains and all other sub-domains to www.example.com re-appending the originally requested path and query string data.