وردپرس

WordPress installation under HTTPS


Moderator
t-p

(@t-p)

I understand that it is a “mixed content” issue

– Disable all caching and optimization plugins,
– Install the plugin Better Search And Replace. Search for http://example.com and replace with https://example.com ; Review this tutorial: https://www.wpbeginner.com/plugins/how-to-fix-the-mixed-content-error-in-wordpress-step-by-step/
– Re-enable your caching and optimiztion plugins and clear the cache.
– Disable/delete “Better Search Replace”.

Thread Starter
qneo

(@qneo)

Thanks for your reply.

Are all these steps necessary?

Is it not possible to set up https in advance for a new site? For example, declare a variable in a config file so that wordpress knows what it’s about right from the start.

I find it strange that you have such a view at all. I almost always install my WordPress projects with SSL, I’ve never seen anything like this.

My tip would be that something is wrong with your server configuration. The styles are probably not being loaded. Have a look at the server to see if you can find any errors there. In the error log, for example

Otherwise, you could also create the wp-config.php manually. To do this, copy wp-config-sample..php and adjust the information in it. There you can also configure the domain to be used with these two entries:

define( 'WP_HOME', 'https://example.com' );
define( 'WP_SITEURL', 'https://example.com' );

Source: https://developer.wordpress.org/advanced-administration/upgrade/migrating/

Thread Starter
qneo

(@qneo)

The styles are probably not being loaded. Have a look at the server to see if you can find any errors there. In the error log, for example

Yes, the dev console shows that requests are sent for css & js files, but via http. So something is not right from the start, maybe something is missing in the config file?

define( 'DB_NAME', 'wp' );

/** Database username */
define( 'DB_USER', 'wp' );

/** Database password */
define( 'DB_PASSWORD', 'wpwp123' );

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

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

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

define( 'AUTH_KEY', 'put your unique phrase here' );
define( 'SECURE_AUTH_KEY', 'put your unique phrase here' );
define( 'LOGGED_IN_KEY', 'put your unique phrase here' );
define( 'NONCE_KEY', 'put your unique phrase here' );
define( 'AUTH_SALT', 'put your unique phrase here' );
define( 'SECURE_AUTH_SALT', 'put your unique phrase here' );
define( 'LOGGED_IN_SALT', 'put your unique phrase here' );
define( 'NONCE_SALT', 'put your unique phrase here' );

$table_prefix = 'wp_';

define( 'WP_DEBUG', false );

/* Add any custom values between this line and the "stop editing" line. */

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

/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) ) {
define( 'ABSPATH', __DIR__ . '/' );
}

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

Add the 2 lines I mentioned above directly after

/* Add any custom values between this line and the “stop editing” line. */

add. And adapt the domain in these lines to your URL – including https.

این خبر را در ایران وب سازان مرجع وب و فناوری دنبال کنید

مشاهده پاسخ های این مطلب
———————————————
این مطلب از سایت انجمن وردپرس گردآوری شده است و کلیه حقوق مطلق به انجمن وردپرس می باشد در صورت مغایرت و یا بروز مشکل اطلاع دهید تا حذف گردد

منبع: انجمن وردپرس

دکمه بازگشت به بالا