admin管理员组文章数量:1426091
I recently set up my WordPress website and just noticed that if I click the home
page from any other page, it points to the IP of my instance and the website won’t load. I have checked the URL(s) from the admin panel Settings → General. They are correctly configured but currently grayed out. Is the only solution to this is to edit the wp-config.php
file?
I recently set up my WordPress website and just noticed that if I click the home
page from any other page, it points to the IP of my instance and the website won’t load. I have checked the URL(s) from the admin panel Settings → General. They are correctly configured but currently grayed out. Is the only solution to this is to edit the wp-config.php
file?
1 Answer
Reset to default 2The URLs are greyed out in the Settings page because of the entries in the wp-config.php
file. If there are entries for these values, those values override the values in the wp-options
table, and the override makes the Settings values uneditable.
See this in the Codex: https://wordpress/support/article/changing-the-site-url/
It is possible to set the site URL manually in the
wp-config.php
file.Add these two lines to your
wp-config.php
, whereexample
is the correct location of your site.define( 'WP_HOME', 'http://example' ); define( 'WP_SITEURL', 'http://example' );
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.
(Emphasis added)
That's why I am not a big fan of making URL changes in the wp-config.php
file. I think it is better (and more proper) to change those values in the wp-options
table. (IMHO).
Look at your wp-config.php
for those two 'defines'. I'd bet that you would find values there. I think that it is better to put those URLs in the wp-options
table. Again, IMHO.
本文标签:
版权声明:本文标题:homepage - When clicking on “home” page from any other page, it goes to IP address and my website doesn’t load 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745466720a2659563.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论