Мой домен вперед на www.www.www.domain.com

В ubuntu server 16.04 У меня есть сайт Wordpress, и я хочу связать его с доменным именем.

Я настроил записи DNS в vutlr и затем я настроил также Виртуальные хосты в своем сервере

Однако, когда я ввожу www.mydomain.com, я передаю www.www.www.mydomain.com

Почему это происходит?

Виртуальный хост:

<VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.
        #ServerName www.example.com

        ServerAdmin  myemail@email.com
        ServerName mydomain.com
        ServerAlias www.mydomain.com
        DocumentRoot /var/www/html/mysite

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/mysite-error.log
        CustomLog ${APACHE_LOG_DIR}/mysite-access.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf

</VirtualHost>

мой wp-config.php

<?php
/**
 * The base configuration for WordPress
 *
 * The wp-config.php creation script uses this file during the
 * installation. You don't have to use the web site, you can
 * copy this file to "wp-config.php" and fill in the values.
 *
 * This file contains the following configurations:
 *
 * * MySQL settings
 * * Secret keys
 * * Database table prefix
 * * ABSPATH
 *
 * @link https://codex.wordpress.org/Editing_wp-config.php
 *
 * @package WordPress
 */

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'mydbsite');

/** MySQL database username */
define('DB_USER', 'sadadsadsadads');

/** MySQL database password */
define('DB_PASSWORD', 'asdadasdadasdassdadas');

/** MySQL hostname */
define('DB_HOST', 'localhost');

/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8mb4');

/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');

/**#@+
 * Authentication Unique Keys and Salts.
 *
 * Change these to different unique phrases!
 * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
 * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
 *
 * @since 2.6.0

 define('AUTH_KEY',         ',<sssssssssssssssssssssssssssssssssssss');
define('SECURE_AUTH_KEY',  'sssssssssssssssssssssssssssssssssssss');
define('LOGGED_IN_KEY',    'Jssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss ');
define('NONCE_KEY',        ':sssssssssssssssssssssssssssssssssssssssssssssssssssssssss');
define('AUTH_SALT',        'sssssssssssssssssssssssssssssssssssssssssssssssssssssssss');
define('SECURE_AUTH_SALT', 'sssssssssssssssssssssssssssssssssssssssssssssssssssssssss');
define('LOGGED_IN_SALT',   'sssssssssssssssssssssssssssssssssssssssssssssssssssssssss');
define('NONCE_SALT',       'sssssssssssssssssssssssssssssssssssssssssssssssssssssssss');

/**#@-*/

/**
 * WordPress Database Table prefix.
 *
 * You can have multiple installations in one database if you give each
 * a unique prefix. Only numbers, letters, and underscores please!
 */
$table_prefix  = 'wp_';

/**
 * For developers: WordPress debugging mode.
 *
 * Change this to true to enable the display of notices during development.



define('WP_DEBUG', false);

/* That's all, stop editing! Happy blogging. */

/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
        define('ABSPATH', dirname(__FILE__) . '/');

/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');

Существует также htcaccess файл в папке wordpess

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

# END WordPress

Также журнал ошибок от apache2

Запрос превысил предел 10 внутренних перенаправлений из-за вероятной ошибки конфигурации. Используйте 'LimitIn$

Наконец настройки в DNS записывают в vultr

enter image description here

ОБНОВЛЕНИЕ: Теперь я перенаправляюсь на www.www.mydomain.com...

0
задан 26 January 2018 в 15:22

1 ответ

Я потратил впустую более чем 3 часа, пытаясь понять, почему простая процедура (я много раз делал это), не работал...

Однако решение было очень просто...

  1. Я изменил дом и siteurl в Настройках - Общий, чтобы иметь доменное имя.
  2. Затем я просто очистил кэш в своем браузере, и все работали

...

0
ответ дан 31 October 2019 в 03:19

Другие вопросы по тегам:

Похожие вопросы: