Forum Moderators: phranque

Message Too Old, No Replies

htaccess not working after changing servers

Moving from one host to another

         

grandma genie

3:50 am on Apr 3, 2012 (gmt 0)

10+ Year Member



Hello,
I just moved my website to a new host, InMotion. The htaccess file I was using with the old host was moved also. However, now the allow deny directives are not working. Other parts of the file still work. It is just blocking IPs that is not. What is happening is instead of getting the normal 403 forbidden they are getting a 302 redirect. Why would the file work on the old servers but not work on the new ones? I have contacted the host. This was their suggestion:

<Files 403.shtml>
order allow,deny
allow from all
</Files>

deny from 1.202.nnn.nn

I do not have a custom 403.shtml file, so this doesn't make sense.

I'm assuming if the file worked on one server is should work on another one and the InMotion server is set up differently. Any ideas? I need to be able to ban certain IPs.

My current htaccess file begins with this:

order allow,deny
deny from 1.202.nnn.nn
allow from all

I have many more IPs in the list, just showing one.

I know my developer when moving the site set up a 302 redirect for anyone using old links, but that shouldn't be causing my banned IPs to be redirected, should it? I haven't heard back from her yet.

The 302 redirect is in essence a block, but not one I want. These rogues need to know they are not welcome.

-- grandma

grandma genie

1:31 am on Apr 26, 2012 (gmt 0)

10+ Year Member



Thanks, Lucy. The redirect to the home page will work. I don't know how bots feel about such things, since they are probably not capable of logical conclusions. Like if the old directory was vintage cars and the new one is antique cars (which is listed on the home page index), a person could figure it out.

I know all my new pages are being indexed correctly by all the search engines. But they still come around looking for the old ones, so I assume a 301 redirect to the home page is better than getting a 404 not found.

Your example worked great. Thank you.
This 31 message thread spans 2 pages: 31