Skip to main content

Lots of redirects in .htacces

Comments

7 comments

  • cPRex Jurassic Moderator
    Hey hey! I don't see why you couldn't remove them. Let's use your example, assuming "somedomain.com" is the domain with the .htaccess file. RewriteCond %{HTTP_REFERER} !^http://somedomain.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://somedomain.com$ [NC] RewriteCond %{HTTP_REFERER} !^http://somedomain.com.hostname.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://somedomain.com.hostname.com$ [NC]
    In this case, it's very unlikely that "somedomain.com.hostname.com" has a DNS record, so that redirect is never going to get applied. Their purpose, I really don't have any idea since it's not a domain that would normally ever exist or get traffic.
    0
  • jeffschips
    The somedomain.com and somedomain.com.hostname.com are just examples of how the naming convention is used - the real names have been removed and the real names and domains DO exist on the server. So I'm wondering, given that they do exist except for how they are enumoerated here, in the example only, what do these redirects actually do?
    0
  • cPRex Jurassic Moderator
    Do those domains actually resolve though? Is there DNS setup for somedomain.hostname.com?
    0
  • jeffschips
    Yes, they all have active, working dns resolution. I.e., if you were to type somedomain.com into your browser you would be brought to somedomain.com
    0
  • cPRex Jurassic Moderator
    Right, but what about somedomain.hostname.com? Does that also exist in DNS and Apache?
    0
  • jeffschips
    When I go into WHM (not cpanel) and view the DNS zone manager and click on manage records, for each domain listed I see the records such as: somedomain.org but DO NOT see any records like somedomain.com.hostname.com which I believe is a naming convention to make cpanel play nicely with whm or something like that - never really quiet undstood that. Does that help?
    0
  • cPRex Jurassic Moderator
    Yup - that helps :D It looks like the rewrites are trying to protect images or hotlinking? Since these are all set up with the HTTP_REFERER option and the rules all reference image types, that would be my guess. But there is no cPanel-related reason you need to keep these in place.
    0

Please sign in to leave a comment.