Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
htaccess ban ip but allow to see custom 403 page...
Old 12-15-2007, 06:20 PM htaccess ban ip but allow to see custom 403 page...
dansgalaxy's Avatar
Defies a Status

Posts: 6,522
Name: Dan
Location: Swindon
Trades: 0
Ok, jsut about to set up my ip banning script, ok htacess

how do i ban a ip but still allow them to see my custom 403 (error.php?type=403) but at the moment it blocks the page,so i get the deault 403 and shows error finding the 403 page?

thanks,
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
 
Register now for full access!
Old 12-15-2007, 11:05 PM Re: htaccess ban ip but allow to see custom 403 page...
Extreme Talker

Posts: 238
Location: United States
Trades: 0
The first part below is the ip blocking section of the .htaccess, and the last line changes the default 403 error to a page of your choice.

Code:
order allow,deny
deny from 127.0.0.1
deny from 1.2.3.4
allow from all

ErrorDocument 403 /your_directory/error.php?type=403
__________________
The interlocking pieces of web development: usability, performance, accessibility, and standards.
frost is offline
Reply With Quote
View Public Profile
 
Old 12-16-2007, 09:17 AM Re: htaccess ban ip but allow to see custom 403 page...
dansgalaxy's Avatar
Defies a Status

Posts: 6,522
Name: Dan
Location: Swindon
Trades: 0
just tried it but it dont work

im using:
Code:
order allow,deny
deny from 86.21.65.226 
allow from all
ErrorDocument 505 /error.php?type=505
ErrorDocument 504 /error.php?type=504
ErrorDocument 503 /error.php?type=503
ErrorDocument 502 /error.php?type=502
ErrorDocument 501 /error.php?type=501
ErrorDocument 500 /error.php?type=500
ErrorDocument 400 /error.php?type=400
ErrorDocument 401 /error.php?type=401
ErrorDocument 403 /error.php?type=403
ErrorDocument 404 /error.php?type=404
ErrorDocument 405 /error.php?type=405
ErrorDocument 408 /error.php?type=408
ErrorDocument 415 /error.php?type=415
ErrorDocument 301 /error.php?type=301
ErrorDocument 302 /error.php?type=302
and im still getting the default and error serving the error.php page
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Old 12-16-2007, 10:52 AM Re: htaccess ban ip but allow to see custom 403 page...
Extreme Talker

Posts: 238
Location: United States
Trades: 0
The ErrorDocument handler might be relative to your base web directory, not the .htaccess file. Is it possible that your error.php file is in a subdirectory? For example, if your error document was located at www.example.com/hi/error.php, then it would most likely need to be ErrorDocument 403 /hi/error.php?type=403
__________________
The interlocking pieces of web development: usability, performance, accessibility, and standards.
frost is offline
Reply With Quote
View Public Profile
 
Old 12-16-2007, 11:07 AM Re: htaccess ban ip but allow to see custom 403 page...
dansgalaxy's Avatar
Defies a Status

Posts: 6,522
Name: Dan
Location: Swindon
Trades: 0
No its in my root, you can see it here: http://calm.dansgalaxy.co.uk/error.php please dont go on it too much i dont want a flood of emails
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Reply     « Reply to htaccess ban ip but allow to see custom 403 page...
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.20742 seconds with 12 queries