I am trying to redirect the URL to the corresponding subdomain.
For example:
example.com/account/user
example.com/account/user2
to
user.example.com
user2.example.com
I have tried:
Redirect /account/user http://user.example.com
but this shows the homepage of example.com
instead of the content of example.com/account/user
.
At the domain level, I set *
as an alias of example.com
.
*
as an alias ofexample.com
." - What exactly do you mean by that? Did you create a "wildcard" CNAME record in the DNS? Did you set theServerAlias
appropriately? Anything else? How doesuser.example.com
route toexample.com/account/user
? It sounds like you are perhaps trying to create the redirect before you've established how the URL routes to the correct place? (Which URL are you linking to?)