teleman
teleman

Reputation: 940

How to configure React Routes for different domains pointing to the same application with different URLs

We have a working React app for http://domain1.com/directory/members/jim

We'd like to use the same app for http://domain2.com/jim

How can we define the routes for the two domains? Or can we put in place a substitution algorithm somewhere?

Upvotes: 0

Views: 175

Answers (1)

geon
geon

Reputation: 8479

You can make both urls work for all domains, but then you can't have a member named "directory". That is a really ugly restriction.

Why don't you just serve 2 different apps on the 2 domains? They can still share 99 % of the code.

Upvotes: 1

Related Questions