Root Relative URLs
Plugin breaks /login redirection when WP installed in a subfolder (2 posts)

  1. GermanKiwi
    Posted 3 years ago #

    Hi, I've just discovered something odd with this plugin...

    I've just installed a brand new WordPress site, but with WordPress installed into a subfolder while the site address points to the root directory.

    In other words, on my General Settings page, I have the following:

    WordPress Address = http://www.example.com/wordpress
    Site Address = http://www.example.com

    (This is a supported configuration as per http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory)

    Everything works perfectly fine, and the site is reachable at http://www.example.com.

    There are a couple of URL aliases/redirections that are built into WP core, which work like this:

    http://www.example.com/login -> http://www.example.com/wordpress/wp-login.php

    http://www.example.com/admin -> http://www.example.com/wordpress/wp-admin

    These are described at http://core.trac.wordpress.org/ticket/19607 and they work regardless of whether WordPress is installed into the root folder or a subfolder. The /login and /admin aliases will always redirect to the correct location of wp-login.php or wp-admin respectively. And they work fine for me on my new WordPress installation.

    However, I then installed the Root Relative URLs plugin (and no other plugins at all).

    Immediately afterwards, I discovered that these alias URLs no longer work! When I log out of WordPress and then go to http://www.example.com/login for example, it just gives me a 404 error instead of redirecting to http://www.example.com/wordpress/wp-login.php like it's supposed to.

    If I disable the Root Relative URLs plugin, then log out again and go to http://www.example.com/login, it redirects correctly as it should.

    So it seems this plugin is breaking the redirection somehow. But I don't know how, or how to fix it.

    Any ideas?


  2. mark_at_kaazing
    Posted 3 years ago #

    I installed the Root Relative URLs plugin today and I had to change the example configuration in wp-config.php to the following:

    define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST']);
    define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/wordpress');
    define('WP_CONTENT_URL', '/wordpress/wp-content');

    You'll see that I altered the second and third line to include /wordpress

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Root Relative URLs
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.