убрать редирект на Wordpress

L2
На сайте с 28.08.2020
Offline
0
315

Не получается сгенерировать новый сертификат SSL. Выдает ошибку:

Проверка владения доменом завершилась неудачно

return code:400

Details:Fetching https://mydomen.com:443/.well-known/acme-challenge/LS7uxz07nQJ7J1bZKtcMrI7KF1o8VeFWnErMM6tY2j0: Timeout during connect (likely firewall problem)


обратился в техподдержку ispsystem, там ответили:


У вас срабатывает редирект с https://www.mydomen.com на https://mydomen.com/ Для выпуска сертификата отключите, пожалуйста, редирект на стороне Wordpress.

curl -vvv https://www.mydomen.com -k * Rebuilt URL to: https://www.mydomen.com/ * Trying **.**.***.***... * TCP_NODELAY set * Connected to www.mydomen.com (**.**.***.***) port 443 (#0) * ALPN, offering h2 * ALPN, offering http/1.1 * successfully set certificate verify locations: * CAfile: /etc/ssl/certs/ca-certificates.crt CApath: /etc/ssl/certs * TLSv1.3 (OUT), TLS handshake, Client hello (1): * TLSv1.3 (IN), TLS handshake, Server hello (2): * TLSv1.2 (IN), TLS handshake, Certificate (11): * TLSv1.2 (IN), TLS handshake, Server key exchange (12): * TLSv1.2 (IN), TLS handshake, Server finished (14): * TLSv1.2 (OUT), TLS handshake, Client key exchange (16): * TLSv1.2 (OUT), TLS change cipher, Client hello (1): * TLSv1.2 (OUT), TLS handshake, Finished (20): * TLSv1.2 (IN), TLS handshake, Finished (20): * SSL connection using TLSv1.2 / ECDHE-RSA-CHACHA20-POLY1305 * ALPN, server accepted to use http/1.1 * Server certificate: * subject: C=XX; CN=mydomen.com; L=XX; O=XX; OU=XX; ST=XX; emailAddress=webmaster@mydomen.com; subjectAltName=www.mydomen.com * start date: Aug 26 14:48:24 2020 GMT * expire date: Aug 25 14:48:24 2021 GMT * issuer: C=XX; CN=mydomen.com; L=XX; O=XX; OU=XX; ST=XX; emailAddress=webmaster@mydomen.com; subjectAltName=www.mydomen.com * SSL certificate verify result: self signed certificate (18), continuing anyway. > GET / HTTP/1.1 > Host: www.mydomen.com > User-Agent: curl/7.58.0 > Accept: */* > < HTTP/1.1 301 Moved Permanently < Server: nginx/1.16.1 < Date: Thu, 27 Aug 2020 07:51:48 GMT < Content-Type: text/html; charset=UTF-8 < Content-Length: 0 < Connection: keep-alive < X-Redirect-By: WordPress < Location: https://mydomen.com/ < Strict-Transport-Security: max-age=31536000; < * Connection #0 to host www.mydomen.com left intact


Вот содержание файла .htaccess:


# BEGIN WordPress

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]

RewriteRule ^(.*)$ https://%1/$1 [R=301,L]

RewriteBase /

RewriteRule ^index\.php$ - [L]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . /index.php [L]

</IfModule>

# END WordPress


Вот содержание файла functions.php:


<?php

if ( ! defined( 'ABSPATH' ) ) {

    exit; // Exit if accessed directly

}


/**

 * Require plugins vendor

 */


require_once get_template_directory() . '/plugins/tgm-plugin-activation/class-tgm-plugin-activation.php';

require_once get_template_directory() . '/plugins/plugins.php';


/**

 * Include the main class.

 */


include_once get_template_directory() . '/framework/classes/class-core.php';



Camille::$template_dir_path   = get_template_directory();

Camille::$template_dir_url    = get_template_directory_uri();

Camille::$stylesheet_dir_path = get_stylesheet_directory();

Camille::$stylesheet_dir_url  = get_stylesheet_directory_uri();


/**

 * Include the autoloader.

 */

include_once Camille::$template_dir_path . '/framework/classes/class-autoload.php';


new Camille_Autoload();


/**

 * load functions for later usage

 */


require_once Camille::$template_dir_path . '/framework/functions/functions.php';


new Camille_Multilingual();


if(!function_exists('Camille')){

    function Camille(){

        return Camille::get_instance();

    }

}


new Camille_Scripts();


new Camille_Admin();


new Camille_WooCommerce();


new Camille_WooCommerce_Wishlist();


new Camille_WooCommerce_Compare();


new Camille_Visual_Composer();


/**

 * Set the $content_width global.

 */

global $content_width;

if ( ! is_admin() ) {

    if ( ! isset( $content_width ) || empty( $content_width ) ) {

        $content_width = (int) Camille()->layout()->get_content_width();

    }

}


require_once Camille::$template_dir_path . '/framework/functions/extra-functions.php';


require_once Camille::$template_dir_path . '/framework/functions/update.php';


Помогите, пожалуйста, понять где спрятался этот редирект и как его отключить?


-S
На сайте с 10.12.2006
Offline
1355
#1
leonid246 :
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]

Вот же, вроде бы.

L2
На сайте с 28.08.2020
Offline
0
#2
-= Serafim =- #:

Вот же, вроде бы.

Это нужно удалить из кода или как-то поменять?

-S
На сайте с 10.12.2006
Offline
1355
#3
leonid246 #:

Это нужно удалить из кода или как-то поменять?

Удалите, когда получите сертификат, то вернете. При условии, что хотите основным сделать зеркало без www.

LEOnidUKG
На сайте с 25.11.2006
Offline
1762
#4

это не стандартные строчки для WP они там не нужны от слова вообще.


RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]

RewriteRule ^(.*)$ https://%1/$1 [R=301,L]

✅ Мой Телеграм канал по SEO, оптимизации сайтов и серверов: https://t.me/leonidukgLIVE ✅ Качественное и рабочее размещение SEO статей СНГ и Бурж: https://getmanylinks.ru/ ✅ Настройка и оптимизация серверов https://getmanyspeed.ru/
E
На сайте с 23.10.2008
Offline
225
#5

Вот чистый код:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Эти 2 строки как раз редиректят:

RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]

RewriteRule ^(.*)$ https://%1/$1 [R=301,L]

Авторизуйтесь или зарегистрируйтесь, чтобы оставить комментарий