0

Background/Setup Information:

Our main server uses NGIX as its base and we also have a cPanel server running our Wordpress installs etc.

On the main server I have used the following to point the url to the cPanel server

NGIX.conf:

location /private/ {
  include proxy-pass-settings.conf;
  proxy_pass  http://vps.domain.com/;
}

On the cPanel server I have created an account using mainNGIXURL.com with a subfolder within the public_html called private were the Wordpress install lives.

In the cPanel public_html .htaccess I have the following that does the redirect.

.htaccess:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?mainNGIXURL\.com$ [NC]
RewriteCond %{REQUEST_URI} !^/[0-9]+\..+\.cpaneldcv$
RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule !^private/ /private%{REQUEST_URI} [L,NC]

Within the private Wordpress install I also have the WP .htaccess as follows

.htaccess:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /private/
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
</IfModule>
# END WordPress

My Wordpress site and home urls are set to https://mainNGIXURL.com/private

Issue:

When I try to access https://mainNGIXURL.com/private/wp-admin or https://mainNGIXURL.com/private/wp-login.php I seem to get redirected to https://mainNGIXURL.com/404

How can I make it so that I can run it correctly?

The front end seems to work 100% its just the admin area thats being strange

0 Answers0