2

We have 301 redirect set from domain A to domain B. Domain A contains a working site.

Is there a way to disable 301 redirect in a browser so that when we come to domain A, we (the programmers/tester) stay on domain A and are not redirected?

  • 1
    Qns is: You want redirection to work only for bots and not for the user ? Is it ? – Mani Jan 5 '16 at 11:52
  • It's theoretically possible for the user-agent to not follow the redirect, however, unless you are serving content then the user won't see anything. Are you trying to achieve something or is this just a hypothetical question? – MrWhite Jan 5 '16 at 12:01
  • 2
    This question pursues two purposes: make sure that no one can access the site which is being redirected and find out whether we have an opportunity still access the site. – Igor Skoldin Jan 5 '16 at 14:37
1

You can't stop the redirect in your browser. You could stop it, but you won't get domain A.
Simply add this line as condition, but with the ip (or ip's) you want, excluding yourself from the redirect:

RewriteCond %{REMOTE_ADDR} !^11\.222\.33\.444 [OR]
RewriteCond %{REMOTE_ADDR} !^11\.222\.33\.445

This way you can test the site, or do whatever you want to it, while the rest of the world sees the other version.

0

It is not possible to do anything in your browser to prevent the redirect. The redirect is sent by the server and the browser has no facility to ignore it. Once the server sends the redirect, it does not send additional content. When you put the redirect in place, it instructs the server to shut down your website. Your "working" website no longer is functional.

As Martijn suggests in his answer you could configure the server to not issue the redirect for specific IP addresses. You could also use cookies that instruct the server not to issue the redirect in certain cases.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.