Possible Duplicate:
Everything You Ever Wanted to Know about Mod_Rewrite Rules but Were Afraid to Ask?
I would like to redirect my web site this way:
http://www.mywebsite.com --> http://mywebsite.com
how can I achieve it in apahce on centos linux?
I would like to redirect my web site this way: http://www.mywebsite.com --> http://mywebsite.com how can I achieve it in apahce on centos linux? | |||
|
feedback
|
This question covers exactly the same ground as earlier questions on this topic; its answers may be merged with another identical question. See the FAQ for guidance on how to improve it.
|
That type of redirect is probably better done with DNS. Make www.mywebsite.com a CNAME entry for mywebsite.com and put an A record in the mywebsite.com entry. | |||
|
feedback
|
|
| |||
|
feedback
|
|
http://httpd.apache.org/docs/2.0/misc/rewriteguide.html Canonical Hostnames Description: The goal of this rule is to force the use of a particular hostname, in preference to other hostnames which may be used to reach the same site. For example, if you wish to force the use of www.example.com instead of example.com, you might use a variant of the following recipe. Solution:
| |||
|
feedback
|