Website forwarding without revealing the forwarding address on browser - html

I am a newbie to building websites. I have a google domain
www.example.com,
and a location:
other.com/myLocation, which contains my actual web page.
Currently, I have enabled website forwarding in google domains, which means, if I enter www.example.com, I get redirected to other.com/myLocation
Is there any way to make it so that I do not get other.com/myLocation, but www.example.com only on my browser?

You could use URL masking, which essentially bakes the destination page inside of an iFrame. Otherwise, depending on the setup, I'd recommend making changes at the DNS level.

Related

Can redirect website/page when site server is down (This Site Can't Be Reached)?

is there any possibility to redirect the website or a page on my site, in case the server crashes (is down) ? I mean, I get sometimes the error "This Site Can't Be Reached", because of my hosting servers, and somehow I want to redirect to another website only when this error appears.
can be done, somehow?
Not directly. You can't send an instruction to the browser to redirect if it can't make a connection to your site in the first place.
You can put another service, with better uptime, in front of your site (e.g. Amazon CloudFront) and have your visitors request from their services instead of directly from yours. Obviously this doesn't work so well if you have personalised content.
CloudFront or another edge-cache would do this for you. It stores a copy of your website in a cache that sits in-front of your website. When it detects your website is unhealthy (i.e. down), it can display some predefined html that you store in e.g. an S3 bucket. In terms of redirecting to another website, you could put a link in that html, but it wouldn't be an automatic 'failover' where if your site is down, another entire web page loads.

Selectively blocking Youtube URLs

Is there a way to selectively block Youtube videos? I know the Chrome policy allows me to block URLs. And I could whitelist URLs. So, I can do this, for example, in a .reg file, for Windows:
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\URLBlacklist]
"1"="youtube.com"
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\URLWhitelist]
"1"="https://www.youtube.com/watch?v=VlPdfLr1FSo"
This would prevent the user from directly browsing to youtube.com or www.youtube.com. But, for that one youtube URL, the user can watch the video. Sounds great, except a few problems.
Once the user gets into Youtube given the above URL that is whitelisted, he is free to click on other links. Or search within the Youtube search interface. Any of those actions will allow the user to view any other youtube video. Note that the URL in Chrome does change to reflect the selected video -- and that video/URL is different from the one I whitelisted. But it's not blocked if the user first goes through the whitelisted URL.
If the user attempts to directly type in another URL (aside from the one that is whitelisted) in the Chrome address bar, then it is blocked. But, navigation within Youtube, after going through the whitelisted URL is not prevented.
Perhaps this is by design. I can see wanting to allow navigation to a given URL, and then movement within an application without everything breaking, in the case of application that is not a single page app. But, in my use case this is not what I want; once the user is granted access to a short list of whitelisted videos, they can then watch anything they want (even if not approved).
Is it possible to use a combination of the Chrome policy to blacklist and whitelist URLs and a Chrome Extension? Could a Chrome extension read the whitelisted URLs, and before navigation within Chrome to a second URL, it could check if the URL is whitelisted (and not blacklisted) and then prevent navigation?

Form Post HTTPS

I'm trying to submit a form back to my server using POST and the target is at the same domain (which is HTTPS) however when I submit I get a Mixed Content error. Does the form post not follow the same protocol as the hosting page? If so what is the best way to fix it without always specifying the full url (I use sub domains for different companies)
Does the form post not follow the same protocol as the hosting page?
It does if a relative URL is specified.
e.g. path relative
action="/form/foo"
or protocol relative
action="//example.com/form/foo"
It appears you have something on your action page, or the page that it redirects to loading over plain HTTP. Use developer tools to hunt out this reference.

Can I show my domain name in links in a URL frame, or similar setup?

I want something between a URL frame and URL redirect.
I have a domain called http://www.mydomain.com.
I have pages on my site. When I click on "page1.html", I would like the address bar of my browser to show "http://www.mydomain.com/page1.html". I want it to show this because then users can click "back" or "forward" in their browsers.
Right now, my domain name provider (Namecheap) has two choices:
URL Frame: This always shows "http://www.mydomain.com", which messes up "back" and "forward" because the subpages aren't shown.
URL Redirect: This causes the address bar to show "http://www.uglydomain.com/subfolder/subsubfolder/page1.html".
What is the best solution? A silly, slightly incomplete solution would be to hard-code all of my links on my pages to "http://www.mydomain.com/page1.html". Can I achieve what I want through .htaccess, redirect rules, or something else?
In theory, if you had access to the site hosting the frame document, you could implement something with pushState and postMessage, but its highly unlikely that you do.
The only real solution is to get proper DNS hosting and point the DNS for the domain at the server hosting your website, and to have sufficiently good hosting that you can set up a virtual name host for the domain on your web server.

ensure embed code (iframe) is only used on customer web sites

I have a service and would like clients to be able to place this service on their website. I am looking at doing this by using an iframe. I will provide the code and they can just copy and paste the code to show the functionality. Each client will be discovered by the query string.
There is a concern that anyone can look at the source of the website, copy the iframe and add it to their own website therefore using the service and charging the original client. I obviously want to stop this.
Ideally, I would like to verify that the website that is using the iframe is linked to the client who registered to use the service. Is this possible at all? I know there are issues with cross domain security.
If it isn't possible, I guess I would need to create a widget instead.
For each client, have a whitelist of web sites that can embed the iframe. Then check the 'referer' header against that list whenever the page inside the iframe is loaded.
Or if http headers prove to be unreliable try using javascript, via parent.document.location.href