Jump to content

WordPress:Merubah URL: Difference between revisions

From Wiki
Created page with "==Edit <code>wp-config.php</code>== It is possible to set the site URL manually in the wp-config.php file. Add these two lines to your wp-config.php, where “example.com” is the correct location of your site. define( 'WP_HOME', 'http://example.com' ); define( 'WP_SITEURL', 'http://example.com' ); This is not necessarily the best fix, it’s just hard-coding the values into the site itself. You won’t be able to edit them on the General settings page anymore when us..."
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 2: Line 2:
It is possible to set the site URL manually in the wp-config.php file.
It is possible to set the site URL manually in the wp-config.php file.


Add these two lines to your wp-config.php, where “example.com” is the correct location of your site.
Add these two lines to your <code>wp-config.php</code>, where <code>example.com</code> is the correct location of your site.


<syntaxhighlight lang="php">
define( 'WP_HOME', 'http://example.com' );
define( 'WP_HOME', 'http://example.com' );
define( 'WP_SITEURL', 'http://example.com' );
define( 'WP_SITEURL', 'http://example.com' );
</syntaxhighlight>
This is not necessarily the best fix, it’s just hard-coding the values into the site itself. You won’t be able to edit them on the General settings page anymore when using this method.
This is not necessarily the best fix, it’s just hard-coding the values into the site itself. You won’t be able to edit them on the General settings page anymore when using this method.
== Source ==
* [https://wordpress.org/support/article/changing-the-site-url/ wordpress.org]
[[Category:CMS]]
[[Category:WordPress]]

Latest revision as of 11:50, 28 November 2022

Edit wp-config.php

It is possible to set the site URL manually in the wp-config.php file.

Add these two lines to your wp-config.php, where example.com is the correct location of your site.

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

This is not necessarily the best fix, it’s just hard-coding the values into the site itself. You won’t be able to edit them on the General settings page anymore when using this method.

Source