fbpx

NGINX: How to config domain subdirectory to point to a subfolder

How To Config Domain Subdirectory To Point To A Subfolder

NGINX: How to config domain subdirectory to point to a subfolder

Oct 3, 2020 – 2 min read

Description

Let’s say your website (e.g. mywebsite.com) is installed in the following directory on your server /var/www/mywebsite and you’d like to install a WordPress blog that can be accessed through the following URL mywebsite.com/blog.

You’ll have to configure NGINX to redirect users requests to a particular directory depending on the requested domain subfolder which in your case is mywebsite.com/blog.

There are two ways to do that.

The subfolder isn’t inside your main folder

The directory structure is the following.

Open your NGINX config file which should be located in /etc/nginx/sites-available/mywebsite and the following code (change it according to your needs).

Check for errors and reload the NGING configurations.

The subfolder is inside the main folder

The directory structure is the following.

Open your NGINX config file and the following code (change it according to your needs).

Check for errors and reload the NGING configurations.

If you need assistance contact me.

Whenever you're ready, here's how I can help you:


1. Develop your Product: Want to start, maintain, and grow your tech business? Our team of senior software engineers at Camplight can help.

A team of +50 employee members and +1500 pre-vetted experts. We have delivered 300+ projects, handled 1200+ consultation requests, gained expertise in 4 key industries. We can manage budget scopes ranging from $1k to $800k+.

​Read more

or

Contact Camplight

2. Join Our Finder’s Fee Program: Refer a client and earn a 10% finder’s fee.

Do you know someone who needs a reliable software development partner to build and grow their product and venture?

At Camplight, we excel in delivering results and innovation for well-funded startups and established businesses, boasting a 95% recommendation rate from our clients.

​Email Our Team at Camplight to Learn More

Tags:
,