Hi guys,
Im currently trying to block off the content of a page if it hasnt been refered by an appropriate url. Im using a basic design and a Customisation with a conditional statement on the server variable HTTP_REFERER
Only problem is after clicking on the refering page I get a blue php error.
PHP Warning
File: [SYSTEM_ROOT]/core/assets/system/conditions/condition_types/condition_server_variable/condition_server_variable.inc Line: 65
Message: Unknown modifier '/'
Backtrace: Show
Am i barking up the wrong tree with this idea?
Are you just inputting a ‘/’ for the match? Matrix is expecting a php preg_match type regular expression (without the delimeters).
At the moment I have the full URL as the match in the pattern field. eg php preg_match
I take it this isnt correct but how would this translate into a preg match?
I think, you would have to escape the special characters, so it would be:
http:\/\/www.test.com\/referpage.asp
If that doesn't work, try escaping the dots as well:
http:\/\/www\.test\.com\/referpage\.asp
[quote]I think, you would have to escape the special characters, so it would be:
http:\/\/www.test.com\/referpage.asp
If that doesn't work, try escaping the dots as well:
http:\/\/www\.test\.com\/referpage\.asp[/quote]
Thanks Daniel that first one worked a treat.
Much appreciated that has solved a BIG problem for us.
[quote]I think, you would have to escape the special characters, so it would be:
http:\/\/www.test.com\/referpage.asp
If that doesn't work, try escaping the dots as well:
http:\/\/www\.test\.com\/referpage\.asp[/quote]
On a side note is it possible to suppress the blue matrix errors that appear if youve come from a site that is outside the restriction list?
PHP Notice
File: [SYSTEM_ROOT]/core/assets/system/conditions/condition_types/condition_server_variable/condition_server_variable.inc Line: 65
Message: Undefined index: HTTP_REFERER
Backtrace: Show
PHP Warning
File: [SYSTEM_ROOT]/core/include/mysource.inc Line: 719
Message: Cannot modify header information - headers already sent by (output started at [SYSTEM_ROOT]/core/include/general.inc:172)
Backtrace: Show
It's probably not possible to suppress those particular errors, but if your site/system is live, you should turn "Show Errors on Frontend" to "Off" in System Preferences to remove all such warnings.