Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pointing domain name to server ip running XAMPP and wordpress

I installed XAMPP on my windows server and also installed Wordpress XAMPP module. I also bought a domain to point it to my server ip. Thing is , I want that when people enter mydomain.com , mydomain.com shows in the address bar and that it keeps showing while browsing.

First I tried to point the domain to my ip , and when I go to mydomain.com it shows mydomain.com/xampp

Then I tried to changing:DocumentRoot "C:\xampp\htdocs" <Directory "C:\xampp\htdocs"> in httpd file in C:\xampp\apache\conf

to

DocumentRoot "C:\xampp\apps\wordpress\htdocs" <Directory "C:\xampp\apps\wordpress\htdocs">

But this time when I enter mydomain.com it redirects to myipaddress.com/wordpress

All I want is: 1)When someone enters mydomain.com , he will see my wordpress home page. 2)Whenever a user is browsing mydomain.com , he will always see mydomain instead of myipaddress.

Any help would be appreciated. Regards!

like image 247
Joseph Avatar asked Oct 29 '25 10:10

Joseph


1 Answers

Type this at the bottom of your httpd file:

Alias /wordpress "C:/xampp/htdocs/wordpress/"
<Directory "C:/xampp/htdocs/wordpress/">
AllowOverride All
Order allow,deny
Allow from all
</Directory>

Please take note that the directory that I stated above is a sample of a default directory. I am having a hard time trying to figure out your directory but the above example should make sense. After typing the codes on your httpd file, go to the directory of xamp/apache/conf/extra/ and openup the httpd-vhosts file. Type this at the bottom of the httpd-vhosts file:

NameVirtualHost *:80

<VirtualHost *:80>
ServerName www.yourdomain.com
ServerAlias yourdomain.com
ServerAdmin [email protected]
DocumentRoot "C:\xampp\htdocs\wordpress"
</VirtualHost>

Double check your host file if you already entered this line:

127.0.0.1     yourdomain.com

Restart your Apache webserver. Hope this helps!

like image 124
BryanCD Avatar answered Oct 31 '25 06:10

BryanCD