|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
I've got a problem in which i want to redirect users on any request to my site - say URL -to just the domain name URL, that is the URL without the www. prefix.
I've already read up on howto do this via the ServerAlias and Redirect directives according to yost.com, so my question (which is actually two questions) is: 1: Is there another way to do redirections on a apache server (or perhaps via DNS or some other sort) 2: If yes to above, is there any downside to the proposed method (being speed of execution on the server, unneccesary bandwidth use etc.)? I'd appreciate some well thought answers. Thanks in advance :), - Mikael |
|
#2
|
||||
|
||||
|
If you want to just have example.com in the browser url, without the http://www. prefix, then i imagine that you could just use the redirect method for apache. so basically for your entry in httpd.conf for http://www.example.com you could have:
Redirect old-URI new-URL or Redirect / http://example.com I don't really know why you would want to do this, when you could just set the document root for http://www.example.com and example.com to the same directory. Either way, the above should work. |
|
#3
|
|||
|
|||
|
wildcarded DNS
what ever you do, the easiest way would be to set you domain widlcarded...
Example : Your webserver is 10.10.10.11 your Domain is : mystupiddomain.foo If this domain isb set up wildcarded for your server in DNS it looks like the following : *.mystupiddomain.foo -> 10.10.10.11 so firstofall http://mystupiddomain.com will be directed to 10.10.10.11 and the nice feature is : cometo.mystupiddomain.com will be also directly delivered to 10.10.10.11 |
![]() |
| Viewing: Dev Shed Forums > System Administration > Apache Development > howto avoid www. prefix? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|