When XAMPP is installed, we can open file using URL like localhost/home.php
. Can we open the very same file like (for example) using an URL like hamzazafeer.com/home.php
or www.hamzazafeer.com/home.php
? Is there any way or we can't change this address?

- 17,148
- 27
- 124
- 216

- 2,360
- 13
- 30
- 42
2 Answers
You can override the domain target to localhost. That means that your browser "thinks" that the domain is on localhost. The browser will fetch then the local files instead of calling a remote server. To do that you have to edit in C:\Windows\System32\drivers\etc a file named hosts
. Depending on your operating system and settings it could be a little hard to edit the file. But you will find further specific information with the help google.
The row you have to add into this file will look like:
127.0.0.1 hamzazafeer.com

- 2,678
- 1
- 17
- 21
Yes and no.
Yes, you can. In default XAMPP installation, it always points to some default folder (htdocs
folder in its root folder under Windows, /var/www
under Linux etc.) This answer may help you locating this folder in your installation of XAMPP).
You can install (FTP copy) XAMPP on any hosting, where your domain hamzazafeer.com
currently points to, and properly configure it (both hosting and domain) to point to your XAMPP's default websites folder and you're ready to go.
(BTW: You're mixing certain things. XAMPP nothing to do with this, it is Apache's configuration variable plus XAMPP / Apache has nothing to do with this in general -- you can point your domain to any folder on any hosting, no matter, what server software is used to serve your website)
No, you shouldn't. XAMPP is from the begining to the very end designed as localhost, test-purpose-only, developer-only solution. You should ever, never use it for serving production version your websites or anywhere on any publicly-accessible hosting. Limit it only to your localhost, as it was meant by XAMPP's creators.
-
i am not asking for that how can it use for service production for website, am just asking about changing the address from localhost to any other name like hamzazafeer/home.php. – Hamza Zafeer Dec 03 '14 at 03:47