Skip to main content

Automatically redirect requests for root domain to www subdomain on all new sites

Comments

3 comments

  • cPanelMichael
    Hello :) The following document explains how to automatically add custom entries to all VirtualHosts on the server: Changes Contained Within a VirtualHost Directive Thank you.
    0
  • DanH42
    Thanks, that looks useful. The changes I need to make will have to reference the name of the domain within themselves. Is there some variable I can use that would represent the current domain? Alternatively, is there a different way to do that redirection that would be domain-agnostic?
    0
  • cPanelMichael
    You can review the template files for the version of Apache installed on your system via: /var/cpanel/templates This should give you a better idea on how to reference a domain name, and is likely the better route compared to attempting to formulate a non-domain specific Mod_Rewrite rule. Thank you.
    0

Please sign in to leave a comment.