I would like to post have a form that sits on a non secure page without using the fully qualified domain name.
http://www.domain.com/page.aspx
post to a secure service on the same domain
https://www.domain.com/service.aspx
I am currently doing this which works.
<form action="https://www.domain.com/service.aspx" id="formId" method="POST">
The main issue is that we have qa versions of the site
http://qa.domain.com/page.aspx
https://qa.domain.com/service.aspx
the form here looks like
<form action="https://qa.domain.com/service.aspx" id="formId" method="POST">
and there is some publishing issues because when we publish from qa to prod we have to manually update the domain name.
What I’d like to do is somehow point to
<form action="/service.aspx" id="formId" method="POST">
but make the form use the prefix https. We can dynamically write the URL in the form, but I was looking for a way to do it with HTML.
Thanks
You can’t do this with URL syntax. You must always restate anything to the right of the component of a URL that you change when constructing relative URLs.
You could generate the URLs programmatically (preferably with server side code).
Note, that as per my comment on the question, you shouldn’t do this.