• Resolved javierba73

    (@javierba73)


    Good afternoon,

    from other external Domain, they have got a link to one post of my WordPress. But i don’t want that they can visit this post directly, i want they cannot access or that they must visit my main page.

    the external domain has got the ‘www.x-x.com’ structure.

    How can i make this?

    Thank you very much.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Are you asking how to disable the ability for other sites to link directly to individual pages on your blog?

    If so, that isn’t a great approach to have when approaching website creation. One of the great freedoms of the web is the ability for information to be linked to and accessed from other places. Preventing ‘deep linking’ is frowned upon, and is more frustrating than it is helpful.

    The only way I can think that this might theoretically be possible would be to check the referral URL, and redirect those visitors to the main page instead. It’s not something that technically I would know how to achieve though, and I definitely wouldn’t encourage it.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    That’s something that you can do with some .htaccess mod_rewrite rules.

    Make a backup copy of our installation’s .htaccess file and add these lines to the top to just block those referers.

    <IfModule mod_rewrite.c>
    RewriteCond %{HTTP_REFERER} www\.x-x\.com [NC]
    RewriteRule .* - [F]
    </IfModule>

    Or redirect those to another URL such as your root.

    <IfModule mod_rewrite.c>
    RewriteCond %{HTTP_REFERER} www\.x-x\.com [NC]
    RewriteRule .* https://your-site-URL-here/ [R=301,L]
    </IfModule>
    Thread Starter javierba73

    (@javierba73)

    Thank you very much. I’m going to test it.

    Thread Starter javierba73

    (@javierba73)

    it didn’t work.
    I had tested something similar.
    I continue looking for.

    Thank you very much

    Thread Starter javierba73

    (@javierba73)

    i want to block one domain which name has got “-” character. How can i scape it?

    Thread Starter javierba73

    (@javierba73)

    I have seen to escape with “\-”

    Thread Starter javierba73

    (@javierba73)

    Resolved, with your help.

    Thank you very much

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Block direct page access from other domain’ is closed to new replies.