• I have WordPress running nicely on my home server. I followed the following guide for this, https://www.osradar.com/install-wordpress-debian-10/ .

    But all WordPress URL are messed up as soon as I access WordPress via public domainname.

    Default home page is resolved/ displayed correctly when I type in the public domainname but all links have the local IP address mentioned and do not resolve.

    All links are stilled messed up also when I adding the following to wp-config.php file:
    #define( ‘WP_HOME’, ‘http://mydomain.com’ );
    #define( ‘WP_SITEURL’, ‘http://mydomain.com’ );

    Very confusing considering everything is a clean install.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Install the plugin “better search replace”. Search for http://123.123.123.123 and replace with http://example.com. You may want to update the local hosts file on your server and other devices on your lan to use the local IP address for the domain rather than routing things out and back.

    Thread Starter roy.samson

    (@roysamson)

    Thanks for your prompt reply, I will try but I am not sure whether that solves the problem. E.g. if I enter http://123.123.123.123 the default WordPress page is loaded, sot it correctly redirects to /var/www/wordpress (all be it without properly loaded stylesheet). When I click on Logon at that page the link is:
    http://123.123.123.123/wordpress/wp-login.php

    Of course that’s wrong because it schould be: http://123.123.123.123/wp-login.php

    So what I don’t get is first perfectly finds it DocumentRoot, i.e. /var/www/wordpress, but in links on the page /wordpress is prefixed again…

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Point your domain (in your virtual host definition) to /var/www/wordpress rather than /var/www so things are easier.

    Thread Starter roy.samson

    (@roysamson)

    It actually already is, but still links displayed have on the page have /wordpress in it added. That’s what confuses me:
    This is my code:
    <VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot /var/www/wordpress
    ServerName mydomain.com
    ServerAlias http://www.mydomain.com

    <Directory /var/www/wordpress>
    Options FollowSymlinks
    AllowOverride All
    Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/mydomain.com_error.log
    CustomLog ${APACHE_LOG_DIR}/mydomain.com_access.log combined

    </VirtualHost>

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    what’s in your .htaccess file? What do you have for the site URL in settings->general?

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Self hosted WordPress’ is closed to new replies.