I have a Drupal install as a sub folder on a droplet. I want to point the domain to this subfolder, ie. 111.111.111.11/drupal. How do I do this within Digital Ocean’s control panel?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
@SterlingDuches That worked perfectly for me. I just have one problem. When I type www.domain.com I get a " page not found ". Do you know how to solve this?
Thanks in advance.
@Joaobborges Setup your CNAME record to catch www too: https://www.digitalocean.com/community/tutorials/how-to-set-up-a-host-name-with-digitalocean
(long tutorial, just scroll down to the CNAME section)
Hi Kirby,
To be technically true, you can’t really “point a domain to a subfolder”, put you can point a domain to an IP, as required by DNS to go on a website using a domain name instead of its IP.
So, in your situation, I much advise you to use Nginx as a reverse proxy, thanks to the use of server_name directives and document root location.
For example, if you want to host many websites on your VPS at IP 111.111.111.11, you can create as many folders you want in /var/www folder, and configure all your nginx virtualhosts to point the correct folder.
tree /var/www/
├── drupal_1
├── drupal_2
Once you have the following tree in your document root, you can use server_name directives to separate your drupal instances relied to a domain name with Nginx, with a configuration file of that kind :
server {
listen *:80;
server_name drupal_1;
root /var/www/drupal_1;
location / {
try_files $uri $uri/index.html $uri.html @upstream;
}
location @upstream {
your php-fpm configuration
}
}
server {
listen *:80;
server_name drupal_2;
root /var/www/drupal_2;
location / {
try_files $uri $uri/index.html $uri.html @upstream;
}
location @upstream {
your php-fpm configuration
}
}
Thanks to that kind of Nginx configuration, I guess that you will be able to do what you are looking for,
Hope this could help,
Best regards,
– rustx
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.