0

I did a redirect in the httpd.conf file

<VirtualHost *:80>
    ServerName y.com *.y.com
    Redirect permanent / http://x.com/
</VirtualHost>

and restarted, but the redirect does not work. The ip address for both domains are the same.

All help appreciated

Thanks Jean

Jean
  • 261
  • 1
  • 7
  • 15

2 Answers2

1

Your ServerName directive is incorrect. Add *.y.com with ServerAlias instead.

joschi
  • 21,387
  • 3
  • 47
  • 50
  • ServerName *.y.com Redirect permanent / http://x.com/ so this would be the correct format? – Jean Oct 31 '10 at 11:03
  • No. Read the linked documentation about `ServerName` and `ServerAlias`. You cannot use wildcards with `ServerName`. – joschi Oct 31 '10 at 11:53
1

to make it clearer what joschi meant:

<VirtualHost *:80>
    ServerName y.com
    ServerAlias *.y.com
    Redirect permanent / http://x.com/
</VirtualHost>
Marcel G
  • 2,269
  • 15
  • 24