0

I have single web application on the server with multiple domain names (pittsburgh-app.com, philadelphia-app.com, etc).

Now the domain names are changing to (new-pittsburgh-app.com, new-philly-app.com, and so on).

So when I setup the following redirection in a new conf file it works:

<VirtualHost *:8080>   ServerName pittsburgh-app.com
  RewriteEngine on
  RewriteRule ^/(.*) http://new-pittsburgh-app.com/$1 [L,R=301]
</VirtualHost>

But the second redirection does not:

<VirtualHost *:8080>   ServerName philadelphia-app.com
  RewriteEngine on
  RewriteRule ^/(.*) http://new-philly-app.com/$1 [L,R=301]
</VirtualHost>

Can I not setup multiple redirections this way?

NB: I setup the second redirection in a separate conf file as well. Port 8080 necessary because that's what the load balancer uses.

Rayhan Muktader
  • 103
  • 1
  • 3

1 Answers1

0

I think the virtual host directives need to be unique, the two you have listed seem to be the same:

old: <VirtualHost *:8080>

new: <VirtualHost www.pittsburgh-app.com:8080>

etc.

Terry Kernan
  • 221
  • 3
  • 7
  • Then I get the following error: [error] (EAI 2)Name or service not known: Could not resolve host name pittsburgh-app.com -- ignoring! Note that I am doing this on a test server and my laptop's hosts file is pointing to the test server's ip but urls are not setup on a public dns – Rayhan Muktader Mar 03 '15 at 20:57
  • have you tried with without the www? – Terry Kernan Mar 03 '15 at 22:20