Issue
I have a token in cookie which i want to validate before redirecting. The validation can be done using a curl call. as shown below
In my httpd.conf file under Virtualhost tag i have this
RewriteEngine on
RewriteCond curl --request POST --header "X-My-Token:MGNhZTdkMzAtMzk4Yi00NTdlLWI5NmItMGVhYWZhNjM0NGNi" http://myhost.com:8888/saml-idp/api/validate-token !^.*"valid":true.*$ [NC]
RewriteRule .* http://SuccessURL.com
It gives me RewriteCond: bad flag delimiters
I know the syntax for RewriteCond can not be this way.
Please suggest me how can i execute this curl call and check the returned response before redirecting.
Solution
While this even might be doable (with prg: External Rewriting Program), really, just don't do it. Write a simple php (or whatever) script.
You have the prg:
example here, but read the comments first :)
Answered By - Dusan Bajic Answer Checked By - Katrina (WPSolving Volunteer)