relative paths

J

jt

our web application is currently using relative paths in
various places throughout our code. im working on
eliminating this, but not sure of the best way to go about
it. i want to avoid hardcoding the path to make migration
easier and more manageable. i thought there is a way to
user the request object?? request.servervariables or
something - any help would be greatly appreciated..

thanks

jt
 
R

Roland Hall

:
: our web application is currently using relative paths in
: various places throughout our code. im working on
: eliminating this, but not sure of the best way to go about
: it. i want to avoid hardcoding the path to make migration
: easier and more manageable. i thought there is a way to
: user the request object?? request.servervariables or
: something - any help would be greatly appreciated..

Why not just start at the root for all links?

/default.asp
/asp/somefile.asp
/js/somefile.js
/images/somefile.jpg

You move this site to another server, a different domain and it all still
works as it does on this site. There is no change unless you modify your
structure.

You can also create a header file that assigns file paths as variables and
create them as constants. Link that in with every page, along with other
header processing routines, so if you decided to change /images to
/pictures, you make one change in the header.

HTH...

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top