Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author intuitart

    (@intuitart)

    Tell me more…

    Were you using this prior to WP 5.8?
    Which editor are you using, Classic or the new editor?
    What are you seeing that suggests it doesn’t work?

    Andrew P.

    Thread Starter tsf999

    (@tsf999)

    Thanks for asking!
    Using 5.8.2, switched to old editor. Basically I run a local server 192.168.0.100 also accessible outside at a domain name, entire thing for testing. All the links point to a local IP address. After applying the plugin, it’s still the case for all pictures and links. I would expect it to alter the links to /wp-content/…. and so on.

    Plugin Author intuitart

    (@intuitart)

    OK, the plugin will only save URLs as relative after it is installed. It doesn’t change those that have already been saved as absolute.

    If you only have a few posts or pages, you can edit each one and save it again. Do this when it is running from the internal IP address if that’s the URL used when the post was created.

    Alternatively, you can add a filter to functions.php that tells the plugin to look for a specific URL and replace it with your new URL. For example:

    add_filter( 'of_absolute_relative_urls_related_sites',
    	function( $related_sites ) {
    		$related_sites[] = "https://192.159.0.100";
    		return $related_sites;
    	}
    );
    

    If you want to run from both URLs as the same time, you can define the wordpress and site URLs in wp-config.php. This tells WP to use the URL from the browser instead of the URLs in Settings. Here is the code for this:

    define( 'WP_SITEURL', $_SERVER['REQUEST_SCHEME'] . '://'. $_SERVER['HTTP_HOST'] );
    define( 'WP_HOME', $_SERVER['REQUEST_SCHEME'] . '://'. $_SERVER['HTTP_HOST'] );
    

    Let me know how you make out.

    Andrew P.

    • This reply was modified 2 years, 11 months ago by intuitart.
    • This reply was modified 2 years, 11 months ago by intuitart.
    • This reply was modified 2 years, 11 months ago by intuitart.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Useless’ is closed to new replies.