@i_want_to_know_everything

Wordpress настройка ЧПУ?

Есть сайт на вордпресс, domain.com работает под nginx
правило для чпу прописано
try_files $uri $uri/ /index.php?q=$request_uri;
В директорию domain.com/data сделана еще одна установка wordpress, без чпу страницы по адресу domain.com/data/?page=test - доступны
С включением чпу domain.com/data/test/ естественно отдается 404 основного сайта.
Как в данном случае прописать настройки чпу для Nginx, чтобы при включении чпу на domain.com/data все работало корректно

весь конфиг
server {
    listen 80;
  server_name domain.com *.domain.com www.domain.com;
  return 301 https://$host$request_uri;
}

server {
    listen 443;
  server_name domain.com *.domain.com www.domain.com;
  charset UTF-8;
  disable_symlinks if_not_owner from=$root_path;
  index index.php;
  root $root_path/$subdomain;
  set $root_path /var/www/user_name/data/www;
  set $subdomain domain.com;
      if ($host ~* ^((.*).domain.com)$) {
        set $subdomain $1;
      }
  access_log /var/www/httpd-logs/domain.com.access.log ;
  error_log /var/www/httpd-logs/domain.com.error.log notice;
  include /etc/nginx/vhosts-includes/*.conf;
  location / {
    location ~ [^/]\.ph(p\d*|tml)$ {
      try_files /does_not_exists @php;
    }
                  try_files $uri $uri/ /index.php?q=$request_uri;
  }
  location @php {
    fastcgi_index index.php;
    fastcgi_param PHP_ADMIN_VALUE "sendmail_path = /usr/sbin/sendmail -t -i -f webmaster@domain.com";
    fastcgi_pass unix:/var/www/php-fpm/user_name.sock;
    fastcgi_split_path_info ^((?U).+\.ph(?:p\d*|tml))(/?.+)$;
    try_files $uri =404;
    include fastcgi_params;
  }
  ssi on;
  add_header Strict-Transport-Security "max-age=31536000;";
  ssl on;
  ssl_certificate "/var/www/httpd-cert/user_name/domain.com.crtca";
  ssl_certificate_key "/var/www/httpd-cert/user_name/domain.com.key";
  ssl_ciphers HIGH:!RC4:!aNULL:!eNULL:!MD5:!EXPORT:!EXP:!LOW:!SEED:!CAMELLIA:!IDEA:!PSK:!SRP:!SSLv2;
  ssl_prefer_server_ciphers on;
  ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
}
  • Вопрос задан
  • 592 просмотра
Решения вопроса 1
wppanda5
@wppanda5 Куратор тега WordPress
WordPress Mедведь
Добавьте перед блоком location @php {
location ~ /data(.*) {
    index index.php;
    try_files $uri /data/index.php?$1&$args;
}
Ответ написан
Комментировать
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы