473,395 Members | 2,689 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Making a relative reference use HTTPS?

Hello,

Is there any notation that would allow me to write a reference to an
HTTPS page without specifying the entire url? For example, right now I
have

<a href="order_form.html">Order Here</a>

I'd like the order form page to appear
"https://mydomain.myhost.com/order_form.html" without writing the
entire url out. Is that possible?

Thanks for your help, - Dave

Feb 4 '06 #1
3 2329
Dan
la***********@zipmail.com wrote:
Is there any notation that would allow me to write a reference to an
HTTPS page without specifying the entire url? For example, right now I
have

<a href="order_form.html">Order Here</a>

I'd like the order form page to appear
"https://mydomain.myhost.com/order_form.html" without writing the
entire url out. Is that possible?


Hmmm... I don't think so, though there's a method of doing a kind-of
"reverse" thing, specifying the hostname without specifying a URI
scheme, with the little-used relative URI syntax starting with a double
slash:

<a href="//hostname.example.org/path/file.html">

which would be dereferenced as
"https://hostname.example.org/path/file.html" if the original page was
accessed via https, or "http://hostname.example.org/path/file.html" if
the original page was accessed via http (and similarly for other
protocols such as ftp). This has occasional (but rare) use when you
have documents accessible by multiple protocols and wish to link them
to other documents of a similar nature in other hosts using the same
protocol by which the user accessed the first document.

There isn't any way to do the opposite and specify the scheme but not
the host, however, since relative URIs aren't allowed to include a
scheme.

--
Dan

Feb 4 '06 #2
la***********@zipmail.com wrote:
Hello,

Is there any notation that would allow me to write a reference to an
HTTPS page without specifying the entire url? For example, right now I
have

<a href="order_form.html">Order Here</a>

I'd like the order form page to appear
"https://mydomain.myhost.com/order_form.html" without writing the
entire url out. Is that possible?

Thanks for your help, - Dave


Dave,

It looks like the answer is a crisp "maybe".

You could read http://www.ietf.org/rfc/rfc2396.txt and the more current
ftp://ftp.rfc-editor.org/in-notes/rfc3986.txt for clarification (or
perhaps not)

Based on my reading:

If the page you are linking from was accessed via https: and does NOT
contain a <base> element, it appears that a relative reference would work.

If the the page you are linking from DOES contain a <base> element and
that base element specifies the https: scheme (and need not specify
anything else), it appears that a relative reference would work.

In both cases, ALL links on the page would use https: as the scheme for
relative references. If that's not what you want, it appears that you
are stuck with using an absolute URI.

And, of course, all this is based on documents and not testing. Only
you can determine if the advantages outweigh the risks.

Chris Beall

Feb 4 '06 #3
la***********@zipmail.com wrote:
Hello,

Is there any notation that would allow me to write a reference to an
HTTPS page without specifying the entire url? For example, right now I
have

<a href="order_form.html">Order Here</a>

I'd like the order form page to appear
"https://mydomain.myhost.com/order_form.html" without writing the
entire url out. Is that possible?


You can't (though it would be a great convenience!).
https://www.example.com is formally a different host from
http://www.example.com. (You may in fact have the web server configured
to direct both host names to the same server and the web site on that
server, but that doesn't alter the overarching syntactical issues.)
Therefore, there is no more a relative connection between the two than
there is between http://server1.example.com and http://server2.example.com.
Feb 6 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

24
by: sinister | last post by:
After doing a websearch, it appears that it's OK to omit the "http:" to form a relative URL. Are there any pitfalls to this? For example, if there is a page http://www.domain1.com/page1.html...
3
by: mrzoab | last post by:
hello........ I'm developing a client software. i'm now actually using an absolute path for my connection string in my program abd this will be a problem when i want to deploy it into another...
2
by: abcd | last post by:
I am using https protocol and some of my pages are using relatie paths to our images folder and gif files... when the page is rendered the images are not rendered.....is there anything wrong...
1
by: Tim Reynolds | last post by:
We use CSS in our staging environment to load balance calls to our web services. However, when adding a web reference to a basic C# .Net windows app, the wsdl & reference.cs generated both point...
10
by: tom | last post by:
hi group, i desperately need a function that will transform relative URLs to absolute URLs in the SRC part of <img> tags. ie: function makeAbsolute($html,$basehref) { //if regex match =...
351
by: CBFalconer | last post by:
We often find hidden, and totally unnecessary, assumptions being made in code. The following leans heavily on one particular example, which happens to be in C. However similar things can (and...
2
by: D Godwin | last post by:
This is probably more of a straight HTML question, but here goes: I want to change from http to https during a form submit. This it pretty straightforward with a complete path...
2
by: scott mcfadden | last post by:
Using VS 2003, I can not add a web reference to our production server's ..asmx URL using HTTPS. I will put in a URL like: https://mycompany.com/myapp/myservice.asmx VStudio will display the...
15
by: Lars Eighner | last post by:
Aside from the deaths of a few extra electrons to spell out the whole root relative path, is there any down side? It seems to me that theoretically it shouldn't make any difference, and it would...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.