can i break the redirect?

ISAPI_Rewrite is a powerful URL manipulation engine based on regular expressions
User avatar
Posts: 5
Joined: 24 May 2012, 11:41

can i break the redirect?

28 May 2012, 08:20

Hi,

I have set up some redirects using the tool, to navigate users from old sites to new sites.

However there is a requirement to enable certain users to break the redirect if needed (to access certain content they may still need).

Can this be done with ISAPI_Rewrite 2.x? If so, how?

Thanks

User avatar
Posts: 19
Joined: 21 Mar 2012, 06:22

Re: can i break the redirect?

28 May 2012, 08:36

kmann wrote:I have set up some redirects using the tool, to navigate users from old sites to new sites.
However there is a requirement to enable certain users to break the redirect if needed (to access certain content they may still need).

Can this be done with ISAPI_Rewrite 2.x? If so, how?


It depends on the used authentication method. If there is a user name inside an URL or cookie or header, for example, then it is possible to exclude it from processing. Otherwise, no.

User avatar
Posts: 5
Joined: 24 May 2012, 11:41

Re: can i break the redirect?

28 May 2012, 11:15

Hi,

Please could you elaborate further (with an example) on how to do this if a username does exist within the URL or cookie?

Thanks

User avatar
Posts: 19
Joined: 21 Mar 2012, 06:22

Re: can i break the redirect?

29 May 2012, 06:10

kmann wrote:Hi,
Please could you elaborate further (with an example) on how to do this if a username does exist within the URL or cookie?


For example, if URL is like https://somesite/someaction?user=user the following condition could be used to stop a rule processing:
RewriteCond URL (?![^?]+\?user=user).*

Since there are many possible variations, it would be better if you tell me the URL (or cookie format) that is interesting for you.

User avatar
Posts: 5
Joined: 24 May 2012, 11:41

Re: can i break the redirect?

30 May 2012, 08:07

Hi,

Makes sense. However say for example the my current redirection rule is as follows:

#Redirect all requests
RewriteCond Host: tstsps101\:45775
RewriteRule /test/.* https\://site.com/default.aspx [I,RP]


Now I want the redirect to stop if it contains 'user=admin' in the URL, for example:
https://tstsps101:45775/test/default.aspx?user=admin
https://tstsps101:45775/test/home.aspx?user=admin
https://tstsps101:45775/test/document.doc?user=admin


What rule can be written to achieve this?

User avatar
Posts: 19
Joined: 21 Mar 2012, 06:22

Re: can i break the redirect?

30 May 2012, 16:11

kmann wrote:Makes sense. However say for example the my current redirection rule is as follows:

#Redirect all requests
RewriteCond Host: tstsps101\:45775
RewriteRule /test/.* https\://site.com/default.aspx [I,RP]


Now I want the redirect to stop if it contains 'user=admin' in the URL, for example:
https://tstsps101:45775/test/default.aspx?user=admin
https://tstsps101:45775/test/home.aspx?user=admin
https://tstsps101:45775/test/document.doc?user=admin


What rule can be written to achieve this?


Try this:
RewriteCond Host: tstsps101\:45775
RewriteRule /test/(?![^?]*\?user=admin).* https\://site.com/default.aspx [I,RP]

Return to ISAPI_Rewrite 2.x

Who is online

Users browsing this forum: No registered users and 8 guests