Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 6 of 6
  1. #1
    Junior Member
    Join Date
    Jul 2007
    Posts
    8
    Member #
    15509
    I've installed WordPress 3.0.1 with multiple blogs enabled with multiple domains as well. I have a photo gallery CMS by Zenphoto and because of the setup on wordpress-mu, all directories have to be on the root directory. I have two domains that can access the directory and need to know if I can restrict a directory that can only be access from one domain. I want to block controlalttv.net from accessing the gallery directory but allow gregschultz.net to the directory.

    I tried this .htacess:

    RewriteEngine on
    RewriteCond %{HTTP_REFERER} refererdomain1\.com [NC]
    RewriteRule .* - [F]

    but it was block by all domains.

    Is there a work-around to my problem or not?

    Thanks for the help,
    Gregory Schultz

  2.  

  3. #2
    Junior Member
    Join Date
    Jul 2007
    Posts
    8
    Member #
    15509
    Can't be done I guess?

  4. #3
    WDF Staff AlphaMare's Avatar
    Join Date
    Oct 2009
    Location
    Montreal, Canada
    Posts
    4,570
    Member #
    20277
    Liked
    878 times
    Be patient - it's been half a day since you posted your question. Sometimes it takes a few days to get a good answer on these forums. The real experts here are professionals, most of them, and I'm pretty sure they have day jobs.

    Meanwhile - use Google to try to answer your question - here are a couple of articles I found that may help -


    and if you find the answer on your own - post it here so we can all benefit and you can gain reputation!
    Good design should never say "Look at me!"
    It should say "Look at this." ~ David Craib


    http://digitalinsite.ca ~ my current site . . info@digitalinsite.ca ~ my email

    If you feel that someone's post helped you fix your problem, answered your question, or just made you feel better, feel free to "Like" their post. The "Like" link is at the bottom right of each post, along side the "reply" link. And if you are being helped here, try to help someone else - pass it on!

  5. #4
    Junior Member
    Join Date
    Jul 2007
    Posts
    8
    Member #
    15509
    I wasn't being impatient in waiting for a response (if I did, I apologize) because all the solutions I was trying came to a dead end.

    And I had no luck. No matter what domain I put in, it denies all access no matter what domain you come from. It either allows all access or zero access.

    order deny, allow
    allow from all
    deny from .controlalttv.net

  6. #5
    Junior Member
    Join Date
    Jul 2007
    Posts
    8
    Member #
    15509
    Update: It somewhat blocked using this code

    RewriteCond %{HTTP_REFERER} controlalttv\.net [NC]
    RewriteRule .* - [F]

    However, you can still view the site from controlalttv.net/gallery but with the css removed.

    Just to be safe, here's the full .htaccess from /gallery
    # htaccess file version 1.2.8.0;
    # When Zenphoto requires changes to the rewrite rules:
    # First make a copy of this file as 'oldhtaccess' in the zp-core folder so setup can test for unmodified files
    # Update the above and the define in setup.php

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTP_REFERER} controlalttv\.net [NC]
    RewriteRule .* - [F]

    RewriteBase /gallery

    RewriteRule ^admin/?$ zp-core/admin.php [R,L]

    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^albums/?(.+/?)?$ $1 [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [L]

    RewriteRule index\.php$ index.php [L,QSA]
    RewriteRule ^page/([0-9]+)/?$ index.php?page=$1 [L,QSA]
    RewriteRule ^page/([A-Za-z0-9_\-]+)/?$ index.php?p=$1 [L,QSA]
    RewriteRule ^page/([A-Za-z0-9_\-]+)/([0-9]+)/?$ index.php?p=$1&page=$2 [L,QSA]
    RewriteRule ^(.*)/page/([0-9]+)/?$ index.php?album=$1&page=$2 [L,QSA]
    RewriteRule ^(.*)/page/([A-Za-z0-9_\-]+)/?$ index.php?album=$1&p=$2 [L,QSA]

    #### Rewrite rule addition for search
    RewriteRule ^page/search/fields([0-9]+)/(.*)/([0-9]+)/?$ index.php?p=search&searchfields=$1&words=$2&page=$ 3 [L,QSA]
    RewriteRule ^page/search/fields([0-9]+)/(.*)/?$ index.php?p=search&searchfields=$1&words=$2 [L,QSA]
    RewriteRule ^page/search/archive/(.*)/([0-9]+)/?$ index.php?p=search&date=$1&page=$2 [L,QSA]
    RewriteRule ^page/search/archive/(.*)/?$ index.php?p=search&date=$1 [L,QSA]
    RewriteRule ^page/search/tags/(.*)/([0-9]+)/?$ index.php?p=search&searchfields=tags&words=$1&page =$2 [L,QSA]
    RewriteRule ^page/search/tags/(.*)/?$ index.php?p=search&searchfields=tags&words=$1 [L,QSA]
    RewriteRule ^page/search/(.*)/([0-9]+)/?$ index.php?p=search&words=$1&page=$2 [L,QSA]
    RewriteRule ^page/search/(.*)/?$ index.php?p=search&words=$1 [L,QSA]
    #### Rewrite additions for zenpage
    RewriteRule ^pages/?$ index.php?p=pages [L,QSA]
    RewriteRule ^pages/(.*)/?$ index.php?p=pages&title=$1 [L,QSA]
    RewriteRule ^news/?$ index.php?p=news [L,QSA]
    RewriteRule ^news/([0-9]+)/?$ index.php?p=news&page=$1 [L,QSA]
    RewriteRule ^news/category/(.*)/([0-9]+)/?$ index.php?p=news&category=$1&page=$2 [L,QSA]
    RewriteRule ^news/category/(.*)/?$ index.php?p=news&category=$1 [L,QSA]
    RewriteRule ^news/archive/(.*)/([0-9]+)/?$ index.php?p=news&date=$1&page=$2 [L,QSA]
    RewriteRule ^news/archive/(.*)/?$ index.php?p=news&date=$1 [L,QSA]
    RewriteRule ^news/(.*)/?$ index.php?p=news&title=$1 [L,QSA]

    RewriteRule ^(.*)/image/(thumb|[0-9]{1,4})/([^/\\]+)$ zp-core/i.php?a=$1&i=$3&s=$2 [L,QSA]
    RewriteRule ^(.*)/image/([^/\\]+)$ zp-core/i.php?a=$1&i=$2 [L,QSA]
    RewriteRule ^(.*)/album/(thumb|[0-9]{1,4})/([^/\\]+)$ zp-core/i.php?a=$1&i=$3&s=$2&album=true [L,QSA]
    ####

    # Catch-all - everything else gets handled in PHP for compatibility.
    RewriteRule ^(.*)/?$ index.php?album=$1 [L,QSA]
    </IfModule>

  7. #6
    Junior Member
    Join Date
    Jul 2007
    Posts
    8
    Member #
    15509
    I think I got it working by using the redirect mode. Is the code correct?

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^(www\.)?controlalttv\.net/.*$ [NC]
    RewriteRule ^(.*)$ Gallery [R=301,L]

    Thanks!


Remove Ads

Posting Permissions

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

Search tags for this page

htaccess allow from domain folder

,

htaccess restrict folder domain

Click on a term to search for related topics.
All times are GMT -6. The time now is 05:55 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com