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.

1
  • Try use %{SERVER_NAME} Commented Mar 3, 2015 at 20:29

1 Answer 1

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.

2
  • 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 Commented Mar 3, 2015 at 20:57
  • have you tried with without the www? Commented Mar 3, 2015 at 22:20

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.