Forum Moderators: phranque

Message Too Old, No Replies

Blocking IP From my site

         

JEramiya

12:34 am on Dec 24, 2002 (gmt 0)

10+ Year Member



Ive tried the .htaccess but it didnt work, he is still viewing my site and givin me problems. What can ido to stop this guy?

jdMorgan

12:49 am on Dec 24, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



JEramiya,

It would be of great help to know what you mean by "it didn't work."

Are you on an Apache server?
Is mod_rewrite available?
Or mod_access?

If you suspect a problem with your code, please post it.

Jim

JEramiya

1:08 am on Dec 24, 2002 (gmt 0)

10+ Year Member



I run savant 3.0 here is the code i tried

order deny,allow
deny from 65.222.106.121
allow from all

jdMorgan

1:24 am on Dec 24, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



JEramiya,

Your code is valid for Apache, but I don't know that it will work on a non-Apache server. You might try the Savant control panel to see if they provide for IP blocking there.

Jim

JEramiya

3:38 am on Dec 24, 2002 (gmt 0)

10+ Year Member



Nope there is nothing of that sort in my contral pannel

kevinpate

3:53 am on Dec 24, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> order deny,allow
> deny from 65.222.106.121
> allow from all

Ok, am I all wet or is the quoted stuff above in inverse order. Seems like it should be

order allow, deny
allow from all
deny from 65.222.106.121

If the allow from all comes last, doesn't that negate the deny from line?

Oh, if I am just all wet, please be kind and delete this post so my ignorance isn't preserved for all time.

Happy holidays

jdMorgan

4:14 am on Dec 24, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Here is the <order> directive in the Apache server mod_access documentation [httpd.apache.org]. I believe that JEramiya has the order correct.

However, I don't know if the Savant Server supports Apache .htaccess and/or mod_access directives within it.

Anybody else running Savant?

Jim

Bobby

10:30 am on Dec 24, 2002 (gmt 0)

10+ Year Member



Could someone please explain the basics of "blocking" access to an I.P. address?
What exactly would I need to do?
I do not currently have any folders on the server called ".htaccess", just the files I've transferred up.
I could contact the guy hosting the site and ask him to make changes but I'd like to know what is necessary first.

thanks

robertito62

1:13 pm on Dec 24, 2002 (gmt 0)

10+ Year Member



Bobby, you can probably do this by yourself.

.htaccess is a text file, like any file written on notepad. It has one directive per line. Some of these will block IPs or domains.

Once the .htaccess has been written all it takes is uploading it to your root directory. At least, that is what I did on my sites and has worked fine.

If noone posts the code for you, I'll do it later today when I get home.

Bobby

1:27 pm on Dec 24, 2002 (gmt 0)

10+ Year Member



I'll give it a try Robertito, using the commands in this post:

order allow, deny
allow from all
deny from xx.xxx.xxx.xxx

When I save it in the root do I simply save it as .htaccess?
Or do I need to give it a name like "deny.htaccess"
Or do I simply save it with .txt extension? ie. "deny.txt"?

jdMorgan

3:39 pm on Dec 24, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Bobby,

When I save it in the root do I simply save it as .htaccess?
Or do I need to give it a name like "deny.htaccess"
Or do I simply save it with .txt extension? ie. "deny.txt"?

It must be named ".htaccess" - that's it.

If you write it on a Windoze machine, you will have to call it something else on the local machine, and then rename it once you've uploaded it to your server. This is a basic incompatibility between Windoze and Unix file-naming conventions - Windoze thinks ".htaccess" is a blank filename with a filetype of "htaccess", and insists that you give the file a name.

I call mine "dot_htaccess.txt" locally, and then rename it to .htaccess once it's on my server.

Jim

Bobby

4:03 pm on Dec 24, 2002 (gmt 0)

10+ Year Member



Well, I gave it a try but the moment I rename the file from "dot_htaccess" to ".htaccess" on the server it disappears! Any ideas?

jdMorgan

4:22 pm on Dec 24, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Bobby,

It is likely still there, but your host is set up to "hide" system files. If the file causes a problem (because it contains errors, for example), just create a blank file, upload it and rename it to .htaccess, thus replacing the bad file.

You might want to ask your hosting company to fix the visibility problem.

Jim

DaveAtIFG

7:03 pm on Dec 24, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Some (maybe most) FTP programs can be set up to display hidden files on a server. I had to figure out how to do this using CuteFTP not too long ago when my host made some unexpected changes and my .htaccess disappeared. It made me REAL nervous 'til I figured out what happened! :)

robertito62

9:02 pm on Dec 24, 2002 (gmt 0)

10+ Year Member



Like jdMorgan said Bobby, it is probably there. And like DaveAtIFG, some programs allow for viewing .htaccess files.

I do not see mines either.

On windows, I believe there is an advance setting to "show all hidden files", that will make .htaccess extensions show up on Windows.

Using Dreamweaver this can be a problem when ftpying...Just trust the file is there.