Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


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

Posted on 2009-02-23
Medium Priority
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:       local.MyApplication.com

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
  • 2
  • 2
LVL 27

Expert Comment

by:Lukasz Chmielewski
ID: 23716227
LVL 29

Accepted Solution

fosiul01 earned 1200 total points
ID: 23716271
HI yah

Your this concept is wrong       local.MyApplication.com

let me explain little bit

suppose your domain is myapplication.com

so if you type: http://myapplication.com 

it wills how you default apache page

now for local.myapplication.com

you need to create a subdomin for that

so /etc/hosts file

do this  myapplication.com  local.myapplicaition.com

and in httpd.conf file

enable this line
NameVirtualHost *:80

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot /www/docs/sub
    ServerName local.myapplicaition.com
    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

ID: 31550324
You Rock, fosiul01!!
LVL 29

Expert Comment

ID: 23716482
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

ID: 23716495
Roads_Roads, thanks for the link as well.

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

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

577 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