Forum Moderators: phranque
RewriteCond %{HTTP_HOST} ^(www.)?example.com$ the main url but not an internal url of the site.
It is not appropriate to expect other members to write your code for you or to debug your entire project; Please don't expect other members to solve a problem you don't want to begin solving yourself.