Thanks in advance for any help provided.
Configuration:
- Debian Jessie
- Front-end Nginx (1 server, 2 server_names; rewrites working correctly),
- Proxied back-end Apache with no rewrites/aliases and other,
- WordPress installed in
/var/www/www.test.blog/wordpress/
with no plugins, - No constants declared in
wp-config.php
.
Task:
I'm trying to make WP being resolved from multiple GET URLs:
test.blog
and www.test.blog
.
Due to Apache logs everything goes just fine until requesting reaches /var/www/www.test.blog/wordpress/index.php
(line:18), after which, suddenly, appears response 301 to test.blog
(line:19)
01:Request received from client: GET /wordpress/ HTTP/1.0
02:Headers received from client:
03:X-Real-IP: 10.0.2.2
04:X-Forwarded-For: 10.0.2.2
05:Host: www.test.blog
06:Connection: close
07:User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36
08:Upgrade-Insecure-Requests: 1
09:Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng
10:DNT: 1
11:Accept-Encoding: gzip, deflate
12:Accept-Language: ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7
13:authorization result of Require all granted: granted
14:authorization result of <RequireAny>: granted
15:request authorized without authentication by access_checker_ex hook: /wordpress/
16:authorization result of Require all granted: granted
17:authorization result of <RequireAny>: granted
18:request authorized without authentication by access_checker_ex hook: /wordpress/index.php
19:Response sent with status 301, headers:
20:Date: Fri, 26 Jan 2018 14:20:49 GMT
21:Server: Apache/2.4.10 (Debian)
22:Location: http://test.blog/wordpress/
23:Content-Length: 0
24:Connection: close
25:Content-Type: text/html; charset=UTF-8
Question:
Can it be that WP itself makes any redirect via PHP? I mean, it's totally capable of it, but does it happen actually (as I have no other suspects)?
And if, what should I do to stop this behavior & finally make it being resolved from multiple URLs?
nginx.conf
- requests to index.php are redirected and handled by WordPress. Is the redirect resulting in you ending up at the wrong page? – phatskat Jan 26 '18 at 17:44www.test.blog
, WP seems to change it totest.blog
. Also it makes new URL visible, changing it in adress bar... I still get target page, but liketest.blog/wordpress/wp-admin...
instead of requestedwww.test.blog/wordpress/wp-admin...
And it drives me a bit mad, as I didn't want URL to change...only redirected behind the scenes... – Denis.Z Jan 26 '18 at 20:23