Skip to main content

How to get WordPress Permalinks working at Subdomains in Directadmin with NGINX only

Also on my server when I uses NGinx only, I was able to get Subdomains working fine with permalinks by adding:

https://[HOSTNAME]:2222/evo/admin/custom-httpd/domain/[DOMAIN_NAME]/nginx/customize/custom4

the following customization:

|*if SUB=”[subdomain]”|
location ~ “^()(/.*)?$”
{
set $template_location “$1/”;
set $relative_location “$2”;
include /etc/nginx/templates/wordpress.conf;
include /usr/local/directadmin/data/users/|USER|/nginx_php.conf;

}

|*endif|

where, [subdomain] is the name of your subdomain, like “test1” or “test2”. If I have 2 subdomains, then I added 2 sections like:
|*if SUB=”[subdomain_1]”|
location ~ “^()(/.*)?$”
{
set $template_location “$1/”;
set $relative_location “$2”;
include /etc/nginx/templates/wordpress.conf;
include /usr/local/directadmin/data/users/|USER|/nginx_php.conf;
}
|*endif|

|*if SUB=”[subdomain_2]”|
location ~ “^()(/.*)?$”
{
set $template_location “$1/”;
set $relative_location “$2”;
include /etc/nginx/templates/wordpress.conf;
include /usr/local/directadmin/data/users/|USER|/nginx_php.conf;
}
|*endif|

Geef een reactie

Je e-mailadres wordt niet gepubliceerd. Vereiste velden zijn gemarkeerd met *