You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Doru-Catalin Togea <do...@ifi.uio.no> on 2003/01/25 21:55:01 UTC

[users@httpd] Aliases for non-CGI references

Hi!

I am developing some web-pages on my home computer, but publish them on an
ISP's webserver.

While at home my links contain hard-coded references like
"E:\someHTMLDirectory\file.html" or "E:\somePicturesDirectory\pic.jpg" and
I can test them.

However, when publishing the web-pages, the links should refer to complete
URLs like "http://myDomain/someHTMLDirectory/file.html" and
"http://myDomain/somePicturesDirectory/pic.jpg".

Converting the referance between home and web locations "by hand" is quite
laborious, and there must be a smarter way of doing it.

If running the win32 Apache 2.0.44 at home, I guess I could set it up to
convert references like "http://myDomain/someHTMLDirectory/file.html" to
some local file, on the fly. At least when doing CGI, one can define
aliases to the CGI directory.

Can anyone tell me how to define "http://myDomain/" to be a general alias
for "E:/", for use in referances which are not calls to CGI programmes? (I
used to run Apache 2.0.43 on win 2000 Pro, it looks now that I'll move
over to 2.0.44 on win XP pro).

Since I generate most of my pages with Python scripts, I could generate a
double set of them, one for home and one for the web, each one with
links correctly coded in, but something tells
me there must be a more elegant way of solving the problem, for instance
by means of using a properly set up web-server. Is there any other 'pro'
approach (that is, one that doesn't involve a web-server)?

Thanks if you can help,
Catalin
--


	<<<< ================================== >>>>
	<<     We are what we repeatedly do.      >>
	<<  Excellence, therefore, is not an act  >>
	<<             but a habit.               >>
	<<<< ================================== >>>>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Aliases for non-CGI references

Posted by Gary Turner <kk...@sbcglobal.net>.
Doru-Catalin Togea wrote:

>Hi!
>
>I am developing some web-pages on my home computer, but publish them on an
>ISP's webserver.
>
>While at home my links contain hard-coded references like
>"E:\someHTMLDirectory\file.html" or "E:\somePicturesDirectory\pic.jpg" and
>I can test them.
>
>However, when publishing the web-pages, the links should refer to complete
>URLs like "http://myDomain/someHTMLDirectory/file.html" and
>"http://myDomain/somePicturesDirectory/pic.jpg".

I don't rate as a guru by any means, so I may be totally off base.  My
question is, why are you using anything on your development machine
other than relative addresses on a directory tree that mimics the
production machine?

Unless you're sending someone off site, is there any pressing need to
use fixed links?  How do you test links if they are different from the
working version?

[...]

-- 
gt                                     kk5st@sbcglobal.net
If you find you've dug yourself into a hole, stoop digging.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Aliases for non-CGI references

Posted by Doru-Catalin Togea <do...@ifi.uio.no>.
On Sat, 25 Jan 2003, Jeff Cohen wrote:

> I don't think I got your point.
> From what I understood, I guess you have an HTML issue here rather then
> Apache.

Indeed it is a HTML issue, but my question was whether I could use a
webserver to solve it. Besides what you write further down, I had already
mentioned a solution to the issue, myself.

Since I am learning about web-publishing it seemed to me to be a smart
question to ask whether Apache can read html files and replace some
base-address of the URLs encountered in the files with something else on
the fly, before giving the files to my browser. I know a little about
Apache, enough to call CGI scripts by means of aliased URLs, so I though
who know what else Apache can do.

Maybe I misunderstand something here. Maybe not all html traffic goes
through Apache, even though it is running in the background. Is it so that
Apache only intervenes when there is some CGI involved when a browser
requests a file?

> When you add links to your pages, add them as /somedirectory/pic.jpg and not
> the whole link, not as e:/somedirectory/pic.jpg and not as
> www.domain1.com/somedirectory/pic.jpg
>
> Just use the route that will be compatible with any base stracture.

Well, I dont't know if it is best to include complete URLs in my HTML
referances or not, but it is indeed off topic for this group.

Thanks
Catalin
--


	<<<< ================================== >>>>
	<<     We are what we repeatedly do.      >>
	<<  Excellence, therefore, is not an act  >>
	<<             but a habit.               >>
	<<<< ================================== >>>>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Aliases for non-CGI references

Posted by Jeff Cohen <ap...@gej-it.com>.
I don't think I got your point.
>From what I understood, I guess you have an HTML issue here rather then
Apache.
When you add links to your pages, add them as /somedirectory/pic.jpg and not
the whole link, not as e:/somedirectory/pic.jpg and not as
www.domain1.com/somedirectory/pic.jpg

Just use the route that will be compatible with any base stracture.

All the best,
Jeff Cohen

> -----Original Message-----
> From: Doru-Catalin Togea [mailto:doru-cat@ifi.uio.no]
> Sent: Saturday, January 25, 2003 3:55 PM
> To: users@httpd.apache.org
> Subject: [users@httpd] Aliases for non-CGI references
> 
> Hi!
> 
> I am developing some web-pages on my home computer, but publish them on an
> ISP's webserver.
> 
> While at home my links contain hard-coded references like
> "E:\someHTMLDirectory\file.html" or "E:\somePicturesDirectory\pic.jpg" and
> I can test them.
> 
> However, when publishing the web-pages, the links should refer to complete
> URLs like "http://myDomain/someHTMLDirectory/file.html" and
> "http://myDomain/somePicturesDirectory/pic.jpg".
> 
> Converting the referance between home and web locations "by hand" is quite
> laborious, and there must be a smarter way of doing it.
> 
> If running the win32 Apache 2.0.44 at home, I guess I could set it up to
> convert references like "http://myDomain/someHTMLDirectory/file.html" to
> some local file, on the fly. At least when doing CGI, one can define
> aliases to the CGI directory.
> 
> Can anyone tell me how to define "http://myDomain/" to be a general alias
> for "E:/", for use in referances which are not calls to CGI programmes? (I
> used to run Apache 2.0.43 on win 2000 Pro, it looks now that I'll move
> over to 2.0.44 on win XP pro).
> 
> Since I generate most of my pages with Python scripts, I could generate a
> double set of them, one for home and one for the web, each one with
> links correctly coded in, but something tells
> me there must be a more elegant way of solving the problem, for instance
> by means of using a properly set up web-server. Is there any other 'pro'
> approach (that is, one that doesn't involve a web-server)?
> 
> Thanks if you can help,
> Catalin
> --
> 
> 
> 	<<<< ================================== >>>>
> 	<<     We are what we repeatedly do.      >>
> 	<<  Excellence, therefore, is not an act  >>
> 	<<             but a habit.               >>
> 	<<<< ================================== >>>>
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org