Wednesday, 21 June 2017

php - Dns add www prefix?






Possible Duplicate:
apache redirect from non www to www






Is it possible to configure DNS to add www. prefix to the domain name?



Here is an example of this


Answer




Nope. You have to configure the webserver at yourdomain.com to redirect to www.yourdomain.com.



For example, on apache, you can use this configuration (using mod_alias):




ServerName www.yourdomain.com
## Actual configuration here...




## redirect non-www to www
ServerName www.yourdomain.com
ServerAlias yourdomain.com

RedirectMatch permanent ^(.*) http://www.yourdomain.com$1


No comments:

Post a Comment

casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...