Author Topic: Domain redirect problem  (Read 8215 times)

0 Members and 1 Guest are viewing this topic.

Domain redirect problem
« on: July 12, 2018, 06:03:22 PM »

I am a bit stuck with the following:

I got my CWP running: Apache & Varnish Cache & Nginx Reverse Proxy
I got 3 domains for 1 user.

Domain is running a drupal site under /home/theuser/public_html
How can I make & redirect to

Redirect and not an alias.
Or using the same homedirectory (/home/theuser/public_html) makes the same site but on 3 different urls which makes your google ranking go down because your content isn't unique)

An alias who give problems for the autossl.

When I create with the default path (/home/theuser/public_html/
I got a http 500 error. Probably due to the .htaccess in the base root (/home/theuser/public_html)

Edited the vhost.conf and use the redirect option
RedirectMatch permanent ^/(.*)$1
This works for http sites. But not when you use or

Hope anyone can help me out with a good solution.

Re: Domain redirect problem
« Reply #1 on: July 13, 2018, 09:00:10 AM »
why not make users for the other domains? way easier!

if for some reason you can't/don't want to:

first make sure you have https for ALL domains in the user
and you'll have to add something like this in the base .htaccess

RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} [NC]
RewriteRule .* https://%{HTTP_HOST}/abc\.com [L,R=301]

also . in folders is bad practice, don't do that (I'm not unsure if you have to outcomment that . in the rewriterule or not.

Re: Domain redirect problem
« Reply #2 on: June 20, 2020, 10:10:29 AM »
Thanks it worked 8)

Re: Domain redirect problem
« Reply #3 on: May 31, 2021, 12:50:06 PM »
I didn't work on Apache Tomcat :( can anyone help?