-1

I have a page that runs tasks and then needs to redirect to other pages that will run tasks but the http redicrect is blocked.

What type of redirects are there and is it possible to redirect without the use of http redirect.

I don't mind breaking the back button or anything like that in this instance as i user wont ask for this, its a scheduled task we call.

Pomster
  • 14,567
  • 55
  • 128
  • 204
  • What do you mean by http redirect? Headers? Just change the property `window.location.href = 'http://new site';` – Daniel W. Oct 21 '13 at 14:11
  • the task that calls my page blocks any redirects out of it, i am trying to redirect with out using the standard redirects like the one u mentioned. – Pomster Oct 21 '13 at 14:18
  • 1
    If you can't redirect through HTTP, what else do you want? Don't use a website for your task then, use C# or AutoIT or whatever – Daniel W. Oct 21 '13 at 14:20

2 Answers2

1

You could use:

window.location.replace("http://example.etc");

or

window.location.href = "http://example.etc";

You can read more about these methods and their behaviors in this answer

Community
  • 1
  • 1
Claudio Holanda
  • 2,455
  • 4
  • 21
  • 25
  • I have already tried those, As i mentioned in my question http redirects are blocked. I need to try some other type of redirect if its possible. – Pomster Oct 21 '13 at 14:16
0

Of course you can redirect using javascript, here's a tutorial. The script that you want is:

window.location = "http://www.google.com/"

Other than that, your page that runs tasks could internally proxy to the new page. It wouldn't be an external redirect so the URL in the browser's location bar won't change. By proxying, the page will need to go out and load the content and then display it to the browser.

This question really doesn't have anything to do with htaccess.

Jon Lin
  • 142,182
  • 29
  • 220
  • 220
  • Could you tell me more about the proxying to a page? a link tutorial would be great thanks. – Pomster Oct 21 '13 at 14:17
  • @Pomster just load the page using whatever language your page is written in and display it. Note that by "loading the page" you are issuing an HTTP request for the page, so if for whatever bizarre reason you can't make HTTP requests at all, this isn't going to help you. – Jon Lin Oct 21 '13 at 14:25