: How to add the ‘www’ prefix to my domain I am trying to add www to my domain. I have the custom PHPcode on live server. I have workout GoDaddy forward options also but still my domain
I am trying to add www to my domain.
I have the custom PHPcode on live server.
I have workout GoDaddy forward options also but still my domain not forward.
I have a site designed in Core PHPand was wondering how to automatically Add the www prefix to my domain?
I have already tried with GoDaddy Forward but still my domain can't redirect:
Also .htaccess not working.
My server configurations:
GoDaddy + Amazon ec2 (Httpd(RHEL))
mod_rewrite enabled
Enabled in etc/httpd/conf/httpd.conf: AllowOverride All
How do I change example.com to www.example.com for my site?
More posts by @Gloria169
1 Comments
Sorted by latest first Latest Oldest Best
From What are the most commonly used and basic Apache htaccess redirects? contributed by bybe:
Catch all and redirect non-www to www
You should opt to use mod_write for redirecting all requests for non www versions of your site because the varible will catch page names, so example.com/page1/ will automaticly redirect to example.com/page1/.
mod_rewrite:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.
RewriteRule ^(.*)$ www.%{HTTP_HOST}/ [R=301,L]
mod_alias:
<If "%{HTTP_HOST} != 'www.example.com'">
Redirect permanent / www.example.com/ </If>
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.