Opened 10 years ago
Closed 9 years ago
#31361 closed defect (bug) (invalid)
WP_SITEURL and WP_HOME breaks the admin bar and disables styles in the login page
Reported by: | gemjeweled | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.1 |
Component: | Administration | Keywords: | reporter-feedback |
Focuses: | administration | Cc: |
Description
Steps to reproduce:
- add the following lines in wp-config.php just above the line
/* That's all, stop editing! Happy blogging. */
:define( 'WP_SITEURL', 'http://sample.wordpress.org' ); define( 'WP_HOME', 'http://sample.wordpress.org' );
- refresh the front end and check via Network in Chrome Developer Tools. dashicons.min.css, admin-bar.min.css and admin.bar.min.js are not loaded. Even the two jQuery files have loading problems as well.
- On view source of the page, the incorrect URLs can be seen (that is, those that start with http://www.... with the slug of the page attached). The slug of the posts are appended as well, which is not desired.
- The same problem can also be seen at the login page - only if a query string is appended to the URL. The stylesheets and scripts do not load properly because the query string is passed along to the stylesheet and script urls. The login page looks fine if there is no query string.
- Same problem still exists even if all plugins are disabled, theme is switched to the default theme (Twenty Fifteen, etc) and even with a clean/reinstalled copy of WordPress.
- Even if the the site and home URL indicated in the database is equal to that of the WP_SITEURL and WP_HOME respectively (that is,
http://sample.wordpress.org
is also indicated in the database), the same problem still persists. In other words, as long as WP_SITEURL and WP_HOME is specified in wp-config.php, this problem occurs.
- Remove/uncomment the two WP_HOME and WP_SITEURL lines above and everything works as expected.
The only resolution is to avoid the use of both constants and simply change the values onto the database.
Change History (2)
Note: See
TracTickets for help on using
tickets.
Could not reproduce on a clean install,
WP_HOME
andWP_SITEURL
work as expected for me.Looking at the screenshots, you have some paths prepended with the current page URL, as well as some root-relative paths. None of this should happen on a clean install, WordPress uses absolute URLs by default.
WP_HOME
andWP_SITEURL
values you have set?