1

I have XAMPP running Apache and MySQL and I have installed WordPress already.

I bought a domain and have made sure that the nameservers can point to my particular IP (which is static) and I've opened that domain outside of my local network so I know it works.

My problem is that when I try and access the website I made on WordPress (nothing fancy, just the basic stuff) it only opens the XAMPP dashboard.

If I manually put in the link it shows up as an error:

'Oops!' error page.

I want the domain that I bought to open up my website.

How do I do that?

  • I did search for other questions on the stack exchange on how to do this and couldn't find anything I could understand to be useful, but I just found: codex.wordpress.org/Changing_The_Site_URL and I think that that may have the answer. If anyone agrees let me know. – Casquibaldo Jun 18 '17 at 23:53
  • Where is your WordPress installation located in your xampp/htdocs folder? What URL did you enter when you got your xampp dashboard? Which one (URL) did you enter when you got the 'Oops!' error page.? – nyedidikeke Jun 19 '17 at 0:10
  • My WordPress installation is on a folder within htdocs. That would be xampp/htdocs/816 (where 816 is the name of the website I made). The URL is that of the domain I bought (say example.com), like this: example.com/wordpress. I also put that in the WordPress settings area where you can edit the site address. Also I would like the URL I use for my website not to have 'wordpress' in it, if that were possible. – Casquibaldo Jun 19 '17 at 0:47
2

Let's assume you've installed WordPress as described here, directly in a folders named 816 under your xampp/htdocs/, and this, without any alterations (modifying settings or any configurations to neither your xampp nor WordPress installation); having defined the nameservers of your domain name (here, example.com) to point to your IP, let's say: 192.182.230.1,

The following apply (when your xampp is up and running with Apache and MySQL started):

  • Visiting example.com in your browser should redirect you to example.com/dashboard/

  • Visiting example.com/816 in your browser should take you to your WordPress installation.

As such, if you've installed your WordPress by accessing localhost/816 in your browser, example.com/816 will redirect you to http://localhost/816, the actual location where your you've installed your WordPress site.

Should you have done so using your IP in place of localhost, I guess example.com/816 should redirect you to 192.182.230.1/816.

In order for example.com/816 to remain unchanged and point directly to your WordPress installation, you can do so by accessing your WordPress administration panel, then, head over to your Settings -> General; there, modify your WordPress Address (URL) and your Site Address (URL) from their current (either http://localhost/816 or http://192.182.230.1/816) states to http://example.com/816 and do remember to click on the Save Changes button so as to effect your modifications.

Should you want to access your WordPress site directly on example.com instead of example.com/816, you will have to set up a virtual host in order to achieve that.

Setting up a virtual host requires you edit your httpd-vhosts.conf file. You can locate it in your xampp/apache/conf/extra/ directory.

You can make use of the snippet below to set up your virtual host by adding it to your httpd-vhosts.conf file.

Do remember to save it, then, restart Apache so as to enable the change you just made take effect.

# VirtualHost for example.com
# Here, it is assumed your xampp was installed directly
# at the root of the drive C of your computer, in a folder named xampp.
<VirtualHost example.com:80>
    DocumentRoot "C:\xampp\htdocs\816"
    ServerAdmin example.com
    <Directory "C:\xampp\htdocs\816">
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

After setting up your virtual host as described above, you can now go to your WordPress Dashboard Settings -> General, then, define example.com as your WordPress Address (URL) and your Site Address (URL); this will enable you to always access the content of your WordPress site directly on your domain name, example.com.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.