Results 1 to 3 of 3

How to use .htaccess to restrict images to one subforum? Using vbseo the forum names are changed.

This is a discussion on How to use .htaccess to restrict images to one subforum? Using vbseo the forum names are changed. within the General Discussion forums, part of the vBSEO SEO Plugin category; I have a subfolder with restricted content. I only want images in that subfolder to show in the restricted content ...

  1. #1
    Junior Member
    Real Name
    frustrated1
    Join Date
    Jul 2010
    Posts
    19
    Liked
    0 times

    How to use .htaccess to restrict images to one subforum? Using vbseo the forum names are changed.

    I have a subfolder with restricted content. I only want images in that subfolder to show in the restricted content subforum whose address is mysite.com/forum/f21. How can I do this with .htaccess? Vbseo changes the subforum names.

    I tried putting the htaccess in the restricted content subfolder but it's not working. Any ideas? Antihotlink works on other domains but I also want the pictures to only be visible when the user is viewing a thread in mysite.com/forum/f21 as opposed to mysite.com/forum/f1 (public forum)

    The restricted content subfolder htaccess has:
    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?mysite.com/forum/f21/ [NC]
    RewriteRule \.(jpg|jpeg|png|gif|pdf)$ mysite.com/antihotlinkpicture.png [NC,R,L]

    The root folder htacccess has
    Options -MultiViews
    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
    RewriteBase /
    RewriteRule ^link([^/]*).html$ rewrite.php?link=$1 [L]

    bunch of 301 redirects, working fine. Any ideas?

  2. #2
    vBSEO Staff Brian Cummiskey's Avatar
    Real Name
    Brian Cummiskey
    Join Date
    Jul 2009
    Location
    btwn NYC and Boston
    Posts
    12,789
    Liked
    657 times
    Blog Entries
    2
    /f21/ isn't a subfolder. If you've created a folder called f21 on your ftp site, you should delete it at once.

    vbseo/mod_rewrite works in such a way that LOGICAL folder names replace PHYSICAL folders.

    HTTP_REFERRER may be inconsistent with vbseo.
    ie,
    forum/f21/some-thread-123/ is actually a showthread script, and does not necessarily contain a referring parameter of f21 in it even though it is in the url.

  3. #3
    Junior Member
    Real Name
    frustrated1
    Join Date
    Jul 2010
    Posts
    19
    Liked
    0 times
    Thanks for the explanation, it's over my head but I'm learning.

    No, I don't have a folder called f21, let me explain some more and let me know if it's possible. My urls are set to be like vbseo's.

    I have folder x with images. I only want the images in folder x to be viewable in mysite/forums/f21 and not on other subforums on my site. This way, people without access to the forum f21 can't share it with people who don't have access to f21.

    An htaccess placed in the folder above folder x does block the contents of folder x from being viewed on other sites. However, when I change it to a "deny all" to test it, I can still view it on my site and others. I suspect this is due to something in the web root's htaccess.

Similar Threads

  1. Changed forum names and now get:
    By Big Island in forum Troubleshooting
    Replies: 5
    Last Post: 01-20-2009, 03:47 PM
  2. Same forum and subforum same names - problem
    By Solmyr in forum Bug Reporting
    Replies: 2
    Last Post: 07-15-2008, 06:20 PM
  3. Replies: 1
    Last Post: 05-31-2007, 11:00 AM
  4. Posts' names changed? Moved?
    By theChronic in forum Pre-Sales Questions
    Replies: 3
    Last Post: 05-25-2006, 11:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •