Local PHP web application custom url (NOT rewriting) on Windows XP and Apache and hosts file

Posted on 2009-02-23
Last Modified: 2013-12-13
I am on XP, running WAMP 2.0 (apache, php, mysql).

I have an application: MyApplication
Local Location: http://localhost/MyApplication/

I would like to customize the url to be something like this:

I have modified my "hosts" file in c:\Windows\system32\drivers\etc\hosts\ to reflect this using the following:

1. I restarted WAMP after updating these and nothing.
2. I restarted the computer and nothing.

I tried updating the "httpd-vhosts.conf" but when I uncomment it the "httpd.conf" using the following, I get WAMP errors.

# Virtual hosts
Include conf/extra/httpd-vhosts.conf

Any ideas?
Question by:khourykris
    LVL 27

    Expert Comment

    by:Lukasz Chmielewski
    LVL 29

    Accepted Solution

    HI yah

    Your this concept is wrong

    let me explain little bit

    suppose your domain is

    so if you type:

    it wills how you default apache page

    now for

    you need to create a subdomin for that

    so /etc/hosts file

    do this

    and in httpd.conf file

    enable this line
    NameVirtualHost *:80

    <VirtualHost *:80>
        DocumentRoot /www/docs/sub
        ErrorLog logs/local.myapplicaition.coml_log
        CustomLog logs/local.myapplicaition.coml_access_log common

    so now if you type
    it will show you the page form /www/docs/sub folder

    Author Closing Comment

    You Rock, fosiul01!!
    LVL 29

    Expert Comment

    hahahah good!

    i really didnot  know you can do this via /etc/hosts file

    i just did this 30 mins ago to check if your concept is right or not, then realized you are 95% right, it does work

    learn new things aswell today

    Author Comment

    Roads_Roads, thanks for the link as well.

    fosiul01, worked perfectly in one try. Thanks it took me a while to solve this.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
    One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
    Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now