Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Subdomain htaccess


jaltronics

Recommended Posts

Posted

Hi all ... I didn't had any big problems until recently! I'm reading and searching the forum nearly every day but unfortunately, I wasn't able to find any informations about my current problem, here or elsewhere!

 

 

So here is the problem :

 

I made a subdomain for my support center (no problems there), I have bots poking around from time to time (to find security holes I guess), I've fixed this with htaccess "deny from xxx.xxx.xxx.xxx" and some automated scripts that adds the lurking IP to the htaccess file (it's all working).

 

After I've setup the subdomain I started to see the bots I've banned come again, here is what I have observed :

 

- they do get the 403 if the lurk the main domain (good!)

- they don't get the 403 error when lurking the subdomain (bad!)

 

I have one htaccess on the main domain and one in the subdomain, both have the bots IP denied, but looks like it's only working for the main domain, though I know my subdomain htaccess work since I've made some tests (made a redirect to the main site and it's working), my big question is "What's going on???"

 

 

If needed I can post the entire content of both my htaccess (they are similar) and my access log file. Any help would be greatly appreciated!

Why is it that when you're driving and looking for an address, you turn down the volume on the radio?

Posted

Is your directory structure something like

main domain: /home/....../public_html/.htaccess (for example)

subdomain: /home/....../public_html/subname/.htaccess ? (subdomain's root is a directory under the main site)

 

The main domain's .htaccess is supposed to be processed, and then all the .htaccess files down the chain of subdirectories to where the code is executing. So, entry into your subdomain should run the main .htaccess and then the subdomain .htaccess. Are your sites arranged differently?

 

The first thing would be to confirm that the main .htaccess is processed, and then the subdomain .htaccess is processed. If not, is the subdomain .htaccess executed first (or only)? I would assume that a second list of IPs to deny would simply be added to a first list, but I wouldn't bet on it. I can't imagine why a list would act to, say, toggle deny "on" and then "off", but stranger things have happened. Are the main .htaccess and subdomain .htaccess IP deny lists identical? If so, and both files are processed, I would just put the list in the main .htaccess, and leave it out of the second. If so, and only one is processed, obviously the list would have to go in the one that's processed.

 

After all that, if you still can't find any rhyme or reason as to why IP deny isn't working in the subdomain, feel free to post both files here, along with whether the main and then the subdomain .htaccess files are processed, or some other order. Don't forget to scrub out any sensitive information such as account names or passwords.

Posted

yes, my structure is like you explained (sorry, forgot to mention that!)

 

Thanks for the explanations, I will look into it and do some tests. I'll remove the deny list from the second file and I'll test on my IP (I'm not gonna ban myself thought it wouldn't be a problem since I have DSL, I can get a new IP in a few seconds! lol).

 

Thanks for pointing me in a direction, I think I'm working too much lately and need some rest since I realized I didn't do some basic test on both files!

Why is it that when you're driving and looking for an address, you turn down the volume on the radio?

Posted

Ok, the problem seems to be fixed!!!

 

I've removed the similarities between the main htaccess file and the one in the subdomain (kept only what was usefull for the subdomain in his htaccess file).

 

Looks like twice the instruction is causing problems (at least on my server's host!).

 

Thanks MrPhil for the reply, it helped me greatly! Now the "ban" are working on the subdomain also!

Why is it that when you're driving and looking for an address, you turn down the volume on the radio?

Posted

Ok, the problem seems to be fixed!!!

That's good news.

 

Looks like twice the instruction is causing problems (at least on my server's host!).

Interesting. So it appears to act like a toggle to disable and then enable those IP addresses? I wonder if that's documented somewhere?

 

Why is it that when you're driving and looking for an address, you turn down the volume on the radio?

Because your brain can't cope with driving and looking for specific information and listening at the same time -- it's simply overloaded. Really.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...