Control Web Panel

WebPanel => CentOS 7 Problems => Topic started by: crystalimited on January 09, 2021, 03:31:05 PM

Title: Domain Redirect
Post by: crystalimited on January 09, 2021, 03:31:05 PM
Hello,
I want to get a pro licence of cwp but i have one question to ask:

When set the server to Apache-Ngnix and Vanish, domain redirect doesn't not work unless using only Apache server. So how can it be possible for domain redirect to work when switched to Apache-ngnix-Vanish server. Or is there any code to use to make domain redirect work when on ngnix. I  mean redirecting from one domain to another. Pls i need answer to  this.
Title: Re: Domain Redirect
Post by: evansa on January 10, 2021, 11:43:33 AM
Please check if you have a redirect already captured in .htaccess
Title: Re: Domain Redirect
Post by: ProComm365 on January 31, 2021, 07:20:41 AM
Please check if you have a redirect already captured in .htaccess

I have a similar problem, but I have CWP7.pro license and JUST Apache server (no Apache-Ngnix and Vanish) and when trying to redirect a subdomain to a specific page, it's not working.

The .htaccess file looks like:

Quote
RewriteEngine on
RewriteOptions inherit
RewriteCond %{HTTP_HOST} ^www\.subdomain\.domain\.tld$
RewriteRule ^$ "https\:\/\/domain\.tld\/specific-page" [R=301,L]
Title: Re: Domain Redirect
Post by: ProComm365 on January 31, 2021, 06:10:29 PM
@josemnunez would you have a workaround for this kind of situations

Please check if you have a redirect already captured in .htaccess

I have a similar problem, but I have CWP7.pro license and JUST Apache server (no Apache-Ngnix and Vanish) and when trying to redirect a subdomain to a specific page, it's not working.

The .htaccess file looks like:

Quote
RewriteEngine on
RewriteOptions inherit
RewriteCond %{HTTP_HOST} ^www\.subdomain\.domain\.tld$
RewriteRule ^$ "https\:\/\/domain\.tld\/specific-page" [R=301,L]
Title: Re: Domain Redirect
Post by: Painkiller88 on March 20, 2021, 07:44:38 AM
If running Apache and NGINX, nginx is your main Webserver and you need to use the nginx syntax for a redirect, don't try to use htaccess apache syntax.

Nginx Redirects are way simpler, you can open an empty .htaccess and just inserst something like that:

Redirect 301 / https://yournewdomain

thats all you need for an nginx redirect.

This will redirect your whole old domain to a new one.
Title: Re: Domain Redirect
Post by: Painkiller88 on March 20, 2021, 07:47:50 AM
@josemnunez would you have a workaround for this kind of situations

Please check if you have a redirect already captured in .htaccess

I have a similar problem, but I have CWP7.pro license and JUST Apache server (no Apache-Ngnix and Vanish) and when trying to redirect a subdomain to a specific page, it's not working.

The .htaccess file looks like:

Quote
RewriteEngine on
RewriteOptions inherit
RewriteCond %{HTTP_HOST} ^www\.subdomain\.domain\.tld$
RewriteRule ^$ "https\:\/\/domain\.tld\/specific-page" [R=301,L]

Your solution would be just this:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^sub\.domain\.com$ [NC]
RewriteRule ^(.*)$ https://www.newdomain.com/$1 [L,R]
Title: Re: Domain Redirect
Post by: ProComm365 on March 20, 2021, 06:29:28 PM
Indeed,
Support game me the solution, by selecting "Do not redirect www"
https://prnt.sc/10r1ny0
Title: Re: Domain Redirect
Post by: linuxnewb2020 on March 24, 2024, 11:57:34 PM
Indeed,
Support game me the solution, by selecting "Do not redirect www"
https://prnt.sc/10r1ny0

I could not get my subdomain redirected or any redirect I created to work. I read a bunch of forums, thought maybe a glitch and almost thought about rebuilding something, I left it alone for a while, came back, and found this.

Thanks! This worked for me