Force full URL in file paths?

T

Travis Pupkin

Hi,

Just curious: is there a bit of ASP code you can place in the top of a
document that will force all root relative image and file paths in the
HTML of this doc to expand to include the full URL?

I doubt it, but before I did it manually, I thought I'd ask. We use a
template of sorts, but need one document to use the full URL, and it
would better to just have it that way in the one document and not the
entire template.

Thanks.
 
A

Aaron Bertrand - MVP

just use full pathing when calling them in the first place, a little bit
of
a hit on perf but will get you the results.

Only because the page size will be a bit larger; there is no difference in
impact on the server in the request for the image itself, when using
http://sameserver.com/img.gif vs. /img.gif ...

A
 
T

Travis Pupkin

Only because the page size will be a bit larger; there is no difference in
impact on the server in the request for the image itself, when using
http://sameserver.com/img.gif vs. /img.gif ...

Yeah, I'm aware of full pathing. My original question was is there a
little bit of server-side code you can put at the top of a page that
uses a template, that will translate root-relative paths into full paths
just for that page. I'm just going to have to create a new template
using full paths for this section, and not use the old template that
carries the code for the rest of the site.

Thanks.
 
A

Aaron Bertrand - MVP

No, just a bigger file. Even with a relative path, it still has to make a
request to the server, which it gets from the URL. I actually think if
anything, it would be LESS work if you specify it absolutely, then there's
no string concatenation etc...
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top