We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on v1 candidate and expect to engage more with the community over the coming months. We are committed to open source, and we encourage contributors to help us build the future of Vesta.
Read file in another domain folder
Read file in another domain folder
Hi,
I don't have much experience in servers and I'm trying to do something but I don't know how to do it and do it in a safe way. What I want is:
I have a server with vestacp and configured two domains: domain1.tld and domain2.tld. When someone access domain1.tld I want the server to read the file in domain2.tld/folder. I tried to do it with a .htaccess file but I get a 400 Bad Request error.
The htaccess file that I used was:
Is the .htaacess right? Maybe I will need to change some folder permissions? If so, will it be safe? Can somebody help me? Thanks.
I don't have much experience in servers and I'm trying to do something but I don't know how to do it and do it in a safe way. What I want is:
I have a server with vestacp and configured two domains: domain1.tld and domain2.tld. When someone access domain1.tld I want the server to read the file in domain2.tld/folder. I tried to do it with a .htaccess file but I get a 400 Bad Request error.
The htaccess file that I used was:
Code: Select all
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteRule ^(.*) ../../domain2.tld/public_html/folder/$1
Re: Read file in another domain folder
Hi, lapsrj
you can change DocumentRoot direcrory for domain1.tld in httpd config of your domains
What operating system on your server?
you can change DocumentRoot direcrory for domain1.tld in httpd config of your domains
What operating system on your server?
Re: Read file in another domain folder
Thanks for your answer, imperio! My server runs Ubuntu.
The problem with changing the DocumentRoot is that I will need to pass a parameter in the url. The parameter is the domain without the tld. The way I thought was: I have the files in domain1.tld/folder. Someone access domain2.tld, the server will read the file in domain1.tld/folder but will add a parameter so the file can know the domain and read the appropriate info.
However I could try put a htaccess in domain1.tld/folder to get the domain and pass as a parameter.
How can I change the DocumentRoot directory? I will test this way.
The problem with changing the DocumentRoot is that I will need to pass a parameter in the url. The parameter is the domain without the tld. The way I thought was: I have the files in domain1.tld/folder. Someone access domain2.tld, the server will read the file in domain1.tld/folder but will add a parameter so the file can know the domain and read the appropriate info.
However I could try put a htaccess in domain1.tld/folder to get the domain and pass as a parameter.
How can I change the DocumentRoot directory? I will test this way.
Re: Read file in another domain folder
/home/$user/conf/web/apache2.conf
in apache2.conf find virtualhost with your domain domain1.tld
find this code
add this
$user - name of your user
domain2.tld - your real domain
also you can change folder public_html
in apache2.conf find virtualhost with your domain domain1.tld
find this code
Code: Select all
DocumentRoot /home/$user/web/domain1.tld/public_html
Code: Select all
DocumentRoot /home/$user/web/domain2.tld/public_html
domain2.tld - your real domain
also you can change folder public_html
Code: Select all
service apache2 restart
Re: Read file in another domain folder
Thanks! I will try it.