I have created a page:
http://mypage.com/paypal
with a custom template that contains the code to grab the ipn response from paypal etc.
Now, I need to redirect users accidentally or on a purpose access
http://mypage.com/paypal
I want to allow that to only when a user is redirected from paypal url. e.g. if it contains http://paypal.com
or https://paypal.com
then it's ok, but all other access redirect to WP homepage.
How to do that?
http://paypal.com...something....
Is it clearer now?wp_redirect
codex.wordpress.org/Function_Reference/wp_redirect if you did want to check the referer I'm not aware of a WordPress native method to do this so you'd probably need to write something yourself. Using something likeparse_url($_SERVER['HTTP_REFERER']);