WordPress.org

Ready to get started?Download WordPress

Forums

Redirect my site (2 posts)

  1. symple1
    Member
    Posted 1 year ago #

    I have a sub-site I manage, I need to figure out how to allow access from only one wordpress page and not direct or from any other site. Can someone please assist, I have been trying this for a few weeks and I'm not getting good results.

    I want to allow access from www,site1.com/login to http://www.site2.com but from nowhere else.

    Again assistance would be very much appreciated.

    Rodney Smith

  2. edpittol
    Member
    Posted 1 year ago #

    I don't know very well your problem.

    If you want block direct access to theme php files. You can put this code in the initiation of your php theme file:

    if( ! defined( 'ABSPATH' ) ) die( 'Forbidden for direct access.' );

    If you want block visit outside of your domain, you can treat the $_SERVER['HTTP_REFERER'].

Topic Closed

This topic has been closed to new replies.

About this Topic