0

can we change base url local host with out using virtual host technique. for example my current base url is: localhost/project and my desire url is abc/project on local host can any one answer as soon as possible

  • why do you want abc on your local machine? – jogesh_pi Feb 08 '14 at 07:07
  • yes jogesh_pi i am working on already exiting project the previous developer was doing something like this he did not configure virtual host and changing base url of localhost instead of localhost he was using abc – Haroon Akram Feb 08 '14 at 07:13
  • the main thing is he hard code the url and it is big project so currently i have to run this as it is then i will change hard coding to dynamic coding but currently short of time i have to do this is there is any way jogesh_pi – Haroon Akram Feb 08 '14 at 07:20
  • for my projects i checked the localhost environment and generate the url according to, and if localhost environment not found then generate the original url. – jogesh_pi Feb 08 '14 at 07:23
  • yup i did that same thing but previous developer did not change httd.conf file , did not change the system32 host file , did not make a virtual host . so i am confuse from where he did that – Haroon Akram Feb 08 '14 at 08:07

3 Answers3

0

You can change your hosts file on your own machine. You can make a pointer from to thus ensuring your computer will look for on your own machine. Next step is to configure in your vhost.

For instance you could change your hosts file so google.com would be pointing to localhost. Once you type google.com in your browser it would try to server a website from your own machine.

Please note that only you (with the changed hostname) will see the website.

See: How to setup the hosts file for multiple domains/hosts with the same ip?

Community
  • 1
  • 1
Luceos
  • 6,629
  • 1
  • 35
  • 65
  • Luceos i know this configuration but dear friend i got one already exiting project in which previous developer replace url with out changing system 32 host file, with out creating virtual host. is there is any other way to do that work – Haroon Akram Feb 08 '14 at 08:12
  • Not on localhost, no. If you have fixed IP on your localhost, you can point your domain through proper DNS settings to your localhost. You then don't need a hosts-file change. However, then, the localhost website would be publicly available, served from your (slow) localhost connection. – Luceos Feb 08 '14 at 09:50
  • Luceos thanks for answer plus you can access localhost with your system name – Haroon Akram Feb 08 '14 at 13:32
0

if you face problem like that, some one is using abc instead of local host then you check your system 32 host file or see the setting of virtual host. If there is no change in these files regarding to your url then start forward check your computer name because you can access your localhost via your computer name as well.

-1

open c:\wamp\bin\apache\Apache[version]\conf\httpd.conf, and set your new path:

DocumentRoot "c:/wamp/www/abc/project"
Moein
  • 36
  • 3