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

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.

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.

Website forwarding without revealing the forwarding address on browser

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.

adding context information to the URL

I need to add context or the current state of my website to the URL of the page.. So that if a user copies and sends the URL to another user. The other user can see the exact state of the website that the sender was watching, i.e. the tab he was in,and the data he was viewing. I have seen similar things being implemented in other websites like facebook, gmail, etc but I don't know how to do that in my application. How should I approach this problem?
Use pushState and friends to modify the URL to one which your server can use to deliver a page that starts in the desired state.

Force domain with frame

I've registered domain.com at Loopia and use their "redirect", which actually opens a website in a frame - in this case mysite.com/domain. However, if I visit mysite.com/domain I want to get redirected to domain.com.
Is this possible, and how would it affect search engines?
Thank you in advance.
You can park your domain instead of redirect it or open your website in a iframe.
When you park your domain, actually your new domain contains all data(s) in previous domain and I think this is a better method.
Furthermore, you don't loose any page rank or SEO ranks.

Forwarding from domain names without using frames

I own a domain name e.g. www.mydomain.com
I also own a web server e.g. www.myserver.com
After navigating to my web server via www.myserver.com clicking on links to different pages within my servers file structure will result in a change in URL...
For example
Clicking on a link to main.html will result in www.myserver.com/main.html
However if I use framed forwarding from my domain name www.mydomain.com and perform the same action the url will not change since only the internal frame containing myserver's content will be changed...
this I know is a fundemental problem with using frames, however there must be some way of maintianing a full url with the domain name i.e.
www.mydomain.com/main.html
I have managed to achieve this with frames by making the links use
href="www.mydomain.com/main.html"
instead of
href="main.html"
But this seems to be a bit of a dirty method in my opinion. Any ideas?
This is probably a very stupid question.
Why use "framed forwarding" It would seem what you are really wanting is the content / data from www.mywebserver.com to show up under www.mydomainname.com .
Simply add the domain to your webserver's configuration and let it serve the content. No frames necessary.