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

x
?
Solved

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

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

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

127.0.0.1/MyApplication/       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?
0
Comment
Question by:khourykris
  • 2
  • 2
5 Comments
 
LVL 27

Expert Comment

by:Lukasz Chmielewski
ID: 23716227
0
 
LVL 29

Accepted Solution

by:
fosiul01 earned 1200 total points
ID: 23716271
HI yah

Your this concept is wrong


127.0.0.1/MyApplication/       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
127.0.0.1  myapplication.com
127.0.0.2  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
</VirtualHost>


so now if you type
http://local.myapplication.com 
it will show you the page form /www/docs/sub folder
0
 

Author Closing Comment

by:khourykris
ID: 31550324
You Rock, fosiul01!!
0
 
LVL 29

Expert Comment

by:fosiul01
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
0
 

Author Comment

by:khourykris
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.
0

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