How to redirect from a html page to a another html page which is on local disk - html

I am creating an appraisal application to accept apraisal for employees and store in the backend, The first page is a login page ,If user has successfully logged in it should redirect to another page which shows employees information but the catch here is that both pages are on local system ,as the browser runs in sandbox mode window.location is not working,I have tried many other similar options but still it doesn't work,I want to know can I use apache or some other server for this purpose.If yes what would be the way to do it

Use the meta-refresh keyword and supply a path.
somebody add an example, don't have one

I tried window.location.href() and got it to work

Here is the example redirection with meta tag.
<meta http-equiv="refresh" content="0;URL='http://bing.com/'" />

Related

How to transparently redirect media files from one website to another?

I have two domains, website1.com and website2.com.
website1.com contains data on it, let's say it's website1.com/picture.jpg.
website2.com is brand new, there's nothing on it, except index.html (though it's possible to put WordPress on it).
I want to transparently mask/redirect/rewrite website2.com over website1.com. So when a person tries to access website2.com/picture.jpg, they get the picture that is physically located on the address website1.com/picture.jpg instead of 404. I know it's possible to do a single-page redirect this way by editing website2.com's index.html:
<meta http-equiv="refresh" content="0; url=http://website1.com/" />
But it will only redirect a single page to a single page. What I want the server to do is to take the path /picture.jpg from website2.com that is nonexistent and automatically redirect it to website1.com/picture.jpg, no matter if it's /picture100.jpg, /pictures/picture.jpg, etc.
Is it possible to do that?

Redirecting unless client has come from paypal

I'm trying to have the HTML code check where a client came from so they can only access this page through a link and we will say this link is from Paypal after purchase and if they don't go through Paypal they will be redirected to the home page of my website, in this case, is home.com (not really).
My Code:
if(!isset($_SERVER['HTTP_REFERER'])){
<meta http-equiv="Refresh" content="0; url='https://bypassdetected!'" />
header('location:../index.php');
exit;
You would need to check if the contents of HTTP_REFERER includes 'paypal.com', although this is a dumb sort of check since it's easily spoofed and accomplishes little of value
Regarding the action your code then takes, you can't combine HTTP header location redirects with HTML redirects, it's one or the other, but if you do try to send both, the headers have to be set before any body content
Redirecting over to PayPal should be avoided in general. You should switch to a PayPal integration that does not use any redirects at all, such as this one: https://developer.paypal.com/demo/checkout/#/pattern/client -- then, your site always stays loaded in the background, which is a far better modern web experience

Redirect Stealthly

<meta http-equiv="refresh" content="3; ,URL=http://www.redirectsiteurl.com">
Trying to redirect from my website but would like to know if it is possible to show the redirect site url instead of the url redirected to. In some web host, they have the option for stealth domain forwarding but unfortunately mine doesn't have this option so I am trying to work around it with META REFRESH
If you're referring to not changing the URL to redirect to another (in my experience), these "stealth redirects" are nothing more than frame-based redirects that take up the entire display:
<body style="height:100%;margin:0;padding:0;">
<iframe width=100% height=100% src="http://stackoverflow.com"></iframe>
</body>
(jsFiddle)
Otherwise, you're going to need to set up a reverse proxy using something along the lines of mod_proxy (a necessity if the page you're "redirecting" to prohibits frames from external locations).
I don't think you do with just HTML. Can you run php? or another scripting language. You probably want to set an HTTP status code of 301 or 302 and redirect.
In php you'd do the following (I know you haven't specified php, but what you're asking is not possibly with just html/js).
header("HTTP/1.1 301 Moved Permanently");
header("Location: somewhere.php");
exit;

how to redirect the page but not change browser's url?

in my project i gave people a restful link,the link would redirect to a page with a lot of params ,i hope people to copy and share the short address instead of the long one.
i use redirect to do it but when the page redirecting, the url on the web browser also change, is there a way to avoid this?
i give a try to use iframe to build an inner page,that seems works,at least on ie10,newest fireforx and chrome
<html><body style="margin:0;padding:0"><iframe src="http://xxxxxx" height="100%" width="100%" frameborder="0"></iframe></body></html>
but it didn't work on some page for example 'www.google.com',and it is said it used x-frame options, but that's the case i didn't need to worry,2 domains both owned by the project. so would that be a solved problem?
Yes. X-Frame option is set if the website doesn't want u to run it in a frame on another domain. Its safe if you want to only run it on your sites. The sites must not have this header or the browser won't allow it to be loaded

How to add a redirect to a web page where you have limited user priveledges

The company I work for has replaced our previously very flexible website with a much more restrictive "website in a box" technology. I have my web pages hosted on Google Sites and would like to redirect people to those pages. When I attempt to do this via javascript it gets stripped from the page when its saved. I do not have access to the section to attempt the depreciated method of redirecting.
Is there another method available to automatically redirect a customer other than just posting a link in a restricted environment like this?
If you're limited to using HTML to do the redirect, you can use a meta redirect:
<meta http-equiv="refresh" content="0; url=http://example.com/">
Though note that its use is deprecated because it may be disorienting to the user. In addition to the <meta> tag, you can add <link rel="canonical" href="http://example.com/"> to let search engines know that the targeted page is the canonical one.
Edit: if Google Sites won't allow you to change the <head> HTML, the Javascript, or the PHP, then it's time to go searching for solutions within Google Sites itself. One solution that pops up pretty frequently in searches seems to be using a URL Redirect Gadget.
On the page you want to redirect from, click the Edit Page button, then Insert Menu, then More Gadgets. Once there, search for "redirect gadgets" and some widgets that should help will show up.
These instructions are based on advice given in the Google Products forums. I don't have a Google Site myself, so I can't verify that they work.