Remote file server redirect to main server

mrvimo

New Member
YetiShare User
YetiShare Supporter
Feb 22, 2021
1
0
1
Hi, i successfully setup the script on both front end main server and remote file server everything is working as accepted.

Now the problem is whenever someone try to access the remote file server (fs1.domain.com) its not redirecting them to domain.com.

I am using vestacp - nginx install, please share me codes and where to paste them.

i am not that good in codes but trying my best, thank you.:)
 

vnxbug

New Member
YetiShare User
YetiShare Supporter
Jun 25, 2018
25
1
3
32
Hi, i successfully setup the script on both front end main server and remote file server everything is working as accepted.

Now the problem is whenever someone try to access the remote file server (fs1.domain.com) its not redirecting them to domain.com.

I am using vestacp - nginx install, please share me codes and where to paste them.

i am not that good in codes but trying my best, thank you.:)
Very easy,

Open your vhost nginx.conf, add this rule in block location / {}

return 301 $scheme://your-main-domain.com$request_uri;

Example :

Code:
location / {
return 301 $scheme://your-main-domain.com$request_uri;
        if (!-e $request_filename) {        
           rewrite ^/(.*) /index.php?_page_url=$1 last;
        }
   }
Reload nginx service and enjoy :)