: You can use this, that will work without typing the domain name itself in file, so can be used in any project. RewriteCond %{HTTP_HOST} !^www. [NC] [or] RewriteCond %{HTTP_HOST} !^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}
you can use this, that will work without typing the domain name itself in file, so can be used in any project.
RewriteCond %{HTTP_HOST} !^www. [NC] [or]
RewriteCond %{HTTP_HOST} !^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$
RewriteRule .? www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
More posts by @Pierce454
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2025 All Rights reserved.