Forum Discussion
Sending Block Page to user
i want to send block page to user
will the below Irule work :
when HTTP_REQUEST {
log local0. "Log me one time"
log local0. " [HTTP::uri] "
HTTP::respond 200 content {
We are sorry, but you cannot access [HTTP::uri]
}
}
it seems to be working , but value [HTTP::uri] inside page is shown as [HTTP::uri] not as the URI ?
12 Replies
- SSHSSH_97332
Nimbostratus
Sorry , below the Irule it seems to be working , but value [HTTP::uri] inside page is shown as [HTTP::uri] not as the URI ?:
when HTTP_REQUEST {
log local0. "Log me one time"
log local0. " [HTTP::uri] "
HTTP::respond 200 content {
Blocking Page
We are sorry, but you were blocked due to [HTTP::uri]
}
} - SSHSSH_97332
Nimbostratus
when HTTP_REQUEST {
log local0. "Log me one time"
log local0. " [HTTP::uri] "
HTTP::respond 200 content {
Blocking Page We are sorry, but you were blocked due to [HTTP::uri]
}
} - SSHSSH_97332
Nimbostratus
when HTTP_REQUEST { log local0. "Log me one time" log local0. " [HTTP::uri] " HTTP::respond 200 content { Blocking Page We are sorry, but you were blocked due to [HTTP::uri] } } - SSHSSH_97332
Nimbostratus
Sorry for multiple posts , Finally i was able tp Paste the Irule , now above the issue is that [ HTTP::uri] inside HTML code appears as it is , URI value doesnot appear like what happens with log local0. " [HTTP::uri] " - What_Lies_Bene1
Cirrostratus
I don't think the variable expansion will work with the {} brackets? Have you tried without?
Alternatively, try using a variable 'set urivariable [HTTP::uri]' and using that in the content instead. - SSHSSH_97332
Nimbostratus
The same result , i tried urivariable & "urivariable" inside HTML
when HTTP_REQUEST { log local0. "Log me one time" log local0. " [HTTP::uri] " set urivariable [HTTP::uri] HTTP::respond 200 content { We are sorry, but you were blocked due to [HTTP::uri] "urivariable" } - What_Lies_Bene1
Cirrostratus
In the respond content don't use [HTTP::uri] "urivariable", use $urivariable. Also, please see if you can remove the {} brackets around the response data.
- SSHSSH_97332
Nimbostratus
didnot workwhen HTTP_REQUEST { log local0. "Log me one time" log local0. " [HTTP::uri] " set x [HTTP::uri] HTTP::respond 200 content { Blocking Page We are sorry, but you were blocked due to $x }
it display as : We are sorry, but you were blocked due to $x - What_Lies_Bene1
Cirrostratus
Can you please remove the {} brackets after 'content'? - What_Lies_Bene1
Cirrostratus
If that still doesn't help, perhaps try HTTP::uri without the [ ] brackets?
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com