Domain redirect via .htaccess and proxy error

Operating System & Version
Cloudlinux 7
cPanel & WHM Version
110.0.6

chkonstadinidis

Registered
May 30, 2023
2
0
1
Athens
cPanel Access Level
Root Administrator
Hello all,

I have the following issue, i need a domain to be redirected to another url while keeping the original on the browser's address bar. I tried the following in .htaccess

RewriteEngine On
RewriteCond %{HTTP_HOST} ^addondomain\.gr$ [NC]
RewriteRule ^$ https://maindomain.gr/page/page2/$1 [P]

And I get Internal Server Error. Here's my error_log

#tail -n0 -f /var/log/apache2/error_log
[Tue May 30 13:27:59.479754 2023] [core:error] [pid 27034] [remote mypublicIP:443] AH01961: failed to enable ssl support [Hint: if using mod_ssl, see SSLProxyEngine]
[Tue May 30 13:27:59.479772 2023] [proxy:error] [pid 27034] AH00961: https: failed to enable ssl support for mypublicIP:443 (maindomain.gr)

It works fine without the proxy enabled.Any ideas?Should i try with a virtual host file and if so how can i do that?
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
16,505
2,605
363
cPanel Access Level
Root Administrator
A proxy indicates a tool that forwards data to another tool, such as Nginx, so it doesn't seem there is any type of proxying happening here.

Many users have had good luck with this code in the past, so you may want to try this in your .htaccess: