How to Change localhost to a Domain Name in XAMPP on Windows

How to Change localhost to a Domain Name in XAMPP on Windows

Hey Guys,

Every new comer web developer must have thought about Changing localhost to a Domain Name while working on websites locally.
Especially while working on WordPress websites. It becomes easy while moving website from local server to live server if we already have domain name in database as we want.

So, Here is easy way to do it.
Happy Coding 🙂

Thnx,
The Next Code

43 Comments

  1. Hector Soto on February 23, 2022 at 10:57 pm

    nope. doesn’t work



  2. ydros69 on February 23, 2022 at 10:57 pm

    hi any idea how to fix mi pablic ip ant fix domainame to the xampp?for online mi sait?



  3. Priyant Gudhka on February 23, 2022 at 11:04 pm

    it takes me to root directory (htdocs) folder. Solution? Did I make any mistake.



  4. Ahmed Badawy on February 23, 2022 at 11:04 pm

    I followed the video and to be able to use the domain name but it did not work. Do i need to change any thing in the setting of Apache after finished all your steps I stopped and restarted Apache again from Xampp control panel



  5. KrisHnA 2k on February 23, 2022 at 11:04 pm

    its work but the domain work only in our local computer



  6. Dark Side Cat on February 23, 2022 at 11:06 pm

    Thanks This Helped A LOT man It helped me develop my website which was not possible because of the file thing, now I can THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS THANKS



  7. zaman rokan on February 23, 2022 at 11:07 pm

    (UNREGISTERED) IN THE httpd-vhost



  8. Cesar Fuenmayor on February 23, 2022 at 11:07 pm

    thanks 🙂



  9. laptop mk on February 23, 2022 at 11:09 pm

    working only on my pc not working worldwide



  10. Kadargo Gaming on February 23, 2022 at 11:13 pm

    Too bad that domain "ONLY" shows on the computer you have running xampp, hehehe, "old trick".



  11. Harley Lumagui on February 23, 2022 at 11:14 pm

    Can this be accessed in a network too?



  12. Testiva Dumatius on February 23, 2022 at 11:18 pm

    Great tip bro. I might add that if you’re using mysql with your php code, don’t forget to change the login credentials to your new localhost pseudo name. I keep my login credentials in one file and then include for each php script that needs it.



  13. ydros69 on February 23, 2022 at 11:19 pm

    its work but the domain work only in our local computer any idea for working online?,



  14. Robin Yong on February 23, 2022 at 11:21 pm

    Thank you for the nice video and it works. I can access http://www.abc.com from localhost but I can’t access my actual online http://www.abc.com from my web browser.Is there a solution?



  15. zahra oveyedzade on February 23, 2022 at 11:24 pm

    helped a lot. thanks



  16. Tom Cho on February 23, 2022 at 11:28 pm

    Very useful tutorial. Keep going!



  17. Onkar Jha on February 23, 2022 at 11:31 pm

    Great bro. But how we can take it online.



  18. CUONG NGUYEN QUOC on February 23, 2022 at 11:31 pm

    Thank you!.



  19. Vin Crafter on February 23, 2022 at 11:32 pm

    hi and welcome to the next.. S I L E N C E
    thank you lol



  20. Straycat on February 23, 2022 at 11:33 pm

    @TheNextCode You make awesome videos! This one helped me a lot. You should have over a million subscribers!



  21. Dany Esc on February 23, 2022 at 11:35 pm

    Thanks Dude.. You helped me . U went for the easy way..



  22. Edj Jan Macababbad on February 23, 2022 at 11:35 pm

    this shows, "internal server error" what should i do?
    thanks



  23. Joe Gonzalez on February 23, 2022 at 11:36 pm

    Hi. Great video man. Can we do this with online? Like a hosted WP site, then we do CLI-Commands? I’ve seen a plugin but I’m hoping we can do it remotely?



  24. Time Lords on February 23, 2022 at 11:36 pm

    i use apache but i don’t mess around with the settings and it makes everything work fine but if you mess around with them without knowing what your doing well your on your own because the green light which usually appear when apache and mysql is on might not work



  25. panpic.vn on February 23, 2022 at 11:39 pm

    Its work for me. Thank you so much



  26. Cleverguns YT on February 23, 2022 at 11:39 pm

    can i use this on my local area connection rather than typing the ip address?



  27. admin isu on February 23, 2022 at 11:44 pm

    it says not secure



  28. Nader Elmor on February 23, 2022 at 11:44 pm

    My apache refuses to start after changing the httpd-vhosts file



  29. Rajinder Singh on February 23, 2022 at 11:46 pm

    Kya wampp server free our safe hai



  30. zaman rokan on February 23, 2022 at 11:47 pm

    # Copyright (c) 1993-2009 Microsoft Corp.
    #
    # This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
    #
    # This file contains the mappings of IP addresses to host names. Each
    # entry should be kept on an individual line. The IP address should
    # be placed in the first column followed by the corresponding host name.
    # The IP address and the host name should be separated by at least one
    # space.
    #
    # Additionally, comments (such as these) may be inserted on individual
    # lines or following the machine name denoted by a ‘#’ symbol.
    #
    # For example:
    #
    # 102.54.94.97 rhino.acme.com # source server
    # 38.25.63.10 x.acme.com # x client host

    # localhost name resolution is handled within DNS itself.
    # 127.0.0.1 localhost
    # ::1 localhost
    I just found these. What can I do?



  31. John Paul De Leon on February 23, 2022 at 11:47 pm

    Is this accesible in local network?



  32. Aman Suryawanshi on February 23, 2022 at 11:47 pm

    thanks man



  33. Nico Gestiada on February 23, 2022 at 11:48 pm

    when i type my domain name it direct me to apache dashboard. pls help



  34. Musab Mahad on February 23, 2022 at 11:48 pm

    Is this domain access any where in the world if your computer connecting to the internet



  35. D.S. on February 23, 2022 at 11:48 pm

    Thanks a bunch!



  36. Yonatan on February 23, 2022 at 11:48 pm

    YOU ALMOST MADE ME LOSE MY FILES!!!!!!!



  37. Vijayakumar K on February 23, 2022 at 11:50 pm

    Thank You so much brother



  38. Armand Iskandarsyah on February 23, 2022 at 11:50 pm

    hi, thanks for the video.
    I’m building a website for Local Area Network only, can it be accessed from LAN?



  39. karthik k on February 23, 2022 at 11:54 pm

    Great video. Thanks a lot



  40. M Sheshant on February 23, 2022 at 11:54 pm

    Thank you so much for making this video, it works perfectly 😊



  41. Rudy Carvalho on February 23, 2022 at 11:55 pm

    Imagine that I have a public IP, how to put online?



  42. Tell me something i don't know on February 23, 2022 at 11:56 pm

    Thank you brother❤️❤️



  43. Domino on February 23, 2022 at 11:56 pm

    Thank you, great video