Need help with a different htaccess problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lamrobertson
    Confirmed User
    • Oct 2002
    • 475

    #1

    Need help with a different htaccess problem

    Well everything I am trying isn't working. Hopefully this is possible. I have two domains. The .com I has the html pages and the .org has the images. So I hotlink my own sites from the .com to the .org. But I think the problem is that on the .com the pages with the content open in a java popup window. Evverything works great until the popwindow opens and then it redirects.

    This is what I have is my htaccess:
    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^http(s)?://([a-z0-9-]+\.)*mydomain.org [NC]
    RewriteCond %{HTTP_REFERER} !^http(s)?://([a-z0-9-]+\.)*mydomain.com [NC]
    RewriteCond %{HTTP_REFERER} !^http(s)?://([a-z0-9-]+\.)*www.mydomain.com [NC]
    RewriteRule /* http://www.mydomain.com/tour/index.shtml [R,L]
    ErrorDocument 400 http://www.mydomain.com/tour/index.shtml

    AddHandler server-parsed .htm .html

    Is it not possible to open the pages as popups? Also the content on the .org domain is divided into folder then subfolders. ie babes then 010, do I have to put a htacess file in each numbered folder?

    Hope someone can help me out. This is driving me nuts.
  • Hostedgallery
    Registered User
    • Jan 2003
    • 37

    #2
    This .htaccess is simpler, and should work like a charm for you:

    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http://.*firstdomain.com [NC]
    RewriteCond %{HTTP_REFERER} !^http://.*seconddomain.org [NC]
    RewriteRule .*\.(gif|GIF|jpg|JPG|mpg|MPG|Mpeg|mpeg|MPEG)$ http://www.firstdomain.com [R,L]

    ErrorDocument 404 http://www.yourdomain.com/
    ErrorDocument 403 http://www.yourdomain.com/
    ErrorDocument 405 http://www.yourdomain.com/
    ErrorDocument 500 http://www.yourdomain.com/

    And of course you can add in your extra handler for parsed documents.

    Post back with your progress.
    <a href="http://www.hostedgallery.com/"><img border="0" src="http://www.hostedgallery.com/boardimages/1_animated.gif" width="120" height="60"></a>
    <font face="Verdana" size="2">ICQ: <a href="http://wwp.icq.com/scripts/contact.dll?msgto=333015437">333015437</a>
    AIM: <a href="aim:goim?screenname=hstdgallery&message=Hell o+There.">hstdgallery</a></font>

    Comment

    • Hostedgallery
      Registered User
      • Jan 2003
      • 37

      #3
      Also, you should be able to drop this .htaccess right in the root directory of the site serving the images. Just make sure of course that you modify it for your proper domains
      <a href="http://www.hostedgallery.com/"><img border="0" src="http://www.hostedgallery.com/boardimages/1_animated.gif" width="120" height="60"></a>
      <font face="Verdana" size="2">ICQ: <a href="http://wwp.icq.com/scripts/contact.dll?msgto=333015437">333015437</a>
      AIM: <a href="aim:goim?screenname=hstdgallery&message=Hell o+There.">hstdgallery</a></font>

      Comment

      Working...