I am running Apache on Mac OS X.
I have this question that I might not be phrasing correctly but maybe someone here can help with an answer.
here is what i want to do -
i want to be able to use the back slash in a URL reference like so:
<img src="/globalimages/spacer.gif">
i want to be able to use this within a Users website, ie if i have a User on the machine and their login is wilbur, so that the URL to their website would be:
http://127.0.0.1/~wilbur
i want the URL :
src="/globalimages/spacer.gif"
to go to:
src="http://127.0.0.1/~wilbur/globalimages/spacer.gif"
AND NOT to src="http://127.0.0.1/globalimages/spacer.gif"
which is what it currenlty does.
I have combed the internet and APache places for this info and have been unsuccessful probably because i don't know how to phrase the question technically. I hope that it is something that I can tweak in the server config. file which I know how to edit and change.
The reason why I want to do this is because I develop websites for various clients and I give each client a User account and then develop the site there. The only problem is that the User account isn't at the root level of the server and therefore I can't use URLs that begin with "/" in order to refer to a global image or file like an include.
It just bugs me that I can't do it and bugs me more that I can't figure it out. Maybe if I read 500 Pages of a Apache manual I would finally find it.
I am really just looking for the answer than I am looking for references that might have the answer that I have to weed through.
Thanks
pink
I have this question that I might not be phrasing correctly but maybe someone here can help with an answer.
here is what i want to do -
i want to be able to use the back slash in a URL reference like so:
<img src="/globalimages/spacer.gif">
i want to be able to use this within a Users website, ie if i have a User on the machine and their login is wilbur, so that the URL to their website would be:
http://127.0.0.1/~wilbur
i want the URL :
src="/globalimages/spacer.gif"
to go to:
src="http://127.0.0.1/~wilbur/globalimages/spacer.gif"
AND NOT to src="http://127.0.0.1/globalimages/spacer.gif"
which is what it currenlty does.
I have combed the internet and APache places for this info and have been unsuccessful probably because i don't know how to phrase the question technically. I hope that it is something that I can tweak in the server config. file which I know how to edit and change.
The reason why I want to do this is because I develop websites for various clients and I give each client a User account and then develop the site there. The only problem is that the User account isn't at the root level of the server and therefore I can't use URLs that begin with "/" in order to refer to a global image or file like an include.
It just bugs me that I can't do it and bugs me more that I can't figure it out. Maybe if I read 500 Pages of a Apache manual I would finally find it.
I am really just looking for the answer than I am looking for references that might have the answer that I have to weed through.
Thanks
pink
-
Re: Novice question regarding root level URLs
Mon, December 6, 2004 - 3:39 PMhttpd.apache.org/docs-2.0/...erdir.html
Read this to find more info on userDir. User Dir can only be implemented when you have dirrect access to the server configuration.
Userdir public_html /usr/web www.foo.com/
This is a example line from the document.
-
Re: Novice question regarding root level URLs
Mon, December 6, 2004 - 6:05 PMWhy use absolute URLs instead of relative ones? I thought relative URLS using .. if necessary were the standard technique. -
-
Re: Novice question regarding root level URLs
Tue, December 7, 2004 - 6:08 AMI _know_ I repsponded to this yesterday, but the message has vanished!
I can't help with specifics, especially since I am not familiar with the MAC setup, but you want to do some research on setting up "Virtual hosts". In addition to adding the info to the Apache's httpd.conf file, on Windows you need to add the virtual-host to the, er, HOSTS file.
On the MAC, well... I dunno.
I beat my head against this one for a week or so, until somebody pointed me in the right direction, and then I beat my head against the specifics for another week...
----
absolute vs. relative : f'r instance, I use PHP to include some fragments that refer to other files; since the fragments can be called from any level of my site sturcture, their inclusions can not be relative, but must be absolutely directed against the root (wherever that may happen to be). with a virtual host on my local machine and absolute paths in my website, my local-mirror and live versions function identically.
for the most part. -
-
Re: Novice question regarding root level URLs
Tue, December 7, 2004 - 5:39 PMIf I were in the original poster's situation, I would probably want to use virtual hosts instead of userdirs, since I found how to do virtual hosting with no additional Apache setup per domain: (advice reposted from an earlier topic)
Using VirtualDocumentRoot, VirtualScriptAlias, and directories whose names are the domains served, is far easier than listing each domain in httpd.conf, as well as the only way I've found to host multiple domains on the same dynamic IP. I missed this technique through a couple of reads of the manual because it takes so little space to describe and most of the section is devoted to explaining the older methods of manually configuring each site.
-
-
-
Re: Novice question regarding root level URLs
Wed, September 14, 2005 - 5:17 AMThanks to all for the help.
I did a google for virtual host and voila found this:
www.macosxhints.com/article.php
You need to go through the comments to make some changes to the '/etc/hosts' file as well.
It worked on the first try!
Thanks again, my life is so much better.
-
-
Re: Novice question regarding root level URLs
Wed, September 14, 2005 - 11:09 AMHe's still adding individual domain names in httpd.conf. With UseCanonicalName on, Apache gets the domain name from each HTTP request, and automatically accesses the corresponding web subdirectory. -
-
Re: Novice question regarding root level URLs
Wed, September 14, 2005 - 1:53 PMYou lost me on UseCanonica...
I just tried looking this up and got really sleepy. But i will look into it more. if you have an UseCanonicalName for Dummies link i'd love to see it.
cheers
p -
-
Re: Novice question regarding root level URLs
Wed, September 14, 2005 - 6:19 PMSearch your httpd.conf and it should be there already; I think it defaults to on from Apache 1.3 on.
-
-
-