Title: Self hosted WordPress
Last modified: December 1, 2020

---

# Self hosted WordPress

 *  [roy.samson](https://wordpress.org/support/users/roysamson/)
 * (@roysamson)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/self-hosted-wordpress-3/)
 * I have WordPress running nicely on my home server. I followed the following guide
   for this, [https://www.osradar.com/install-wordpress-debian-10/](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&#8217](http://mydomain.com&#8217););#
   define( ‘WP_SITEURL’, ‘[http://mydomain.com&#8217](http://mydomain.com&#8217););
 * Very confusing considering everything is a clean install.

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

 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [5 years, 6 months ago](https://wordpress.org/support/topic/self-hosted-wordpress-3/#post-13731375)
 * 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](https://wordpress.org/support/users/roysamson/)
 * (@roysamson)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/self-hosted-wordpress-3/#post-13731464)
 * 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](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](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](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)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [5 years, 6 months ago](https://wordpress.org/support/topic/self-hosted-wordpress-3/#post-13731469)
 * Point your domain (in your virtual host definition) to /var/www/wordpress rather
   than /var/www so things are easier.
 *  Thread Starter [roy.samson](https://wordpress.org/support/users/roysamson/)
 * (@roysamson)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/self-hosted-wordpress-3/#post-13731788)
 * 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
   [admin@mydomain.com](https://wordpress.org/support/topic/self-hosted-wordpress-3/admin@mydomain.com?output_format=md)
   DocumentRoot /var/www/wordpress ServerName mydomain.com ServerAlias [http://www.mydomain.com](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)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [5 years, 6 months ago](https://wordpress.org/support/topic/self-hosted-wordpress-3/#post-13732013)
 * 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.

 * In: [Installing WordPress](https://wordpress.org/support/forum/installation/)
 * 5 replies
 * 2 participants
 * Last reply from: [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * Last activity: [5 years, 6 months ago](https://wordpress.org/support/topic/self-hosted-wordpress-3/#post-13732013)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
