The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

how to redirect ips to different error pages?

Discussion in 'General Discussion' started by johnnylu, Mar 18, 2004.

  1. johnnylu

    johnnylu Member

    Joined:
    Mar 17, 2004
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    I already set the document error pages for my website. But i want to redirect different IPs to different error pages of the same error. (e.g 11.11.11.11 to 403_1.htm, 22.22.22.22 to 403_2.htm)

    Any help will be most appreciated!
     
  2. bamasbest

    bamasbest Well-Known Member

    Joined:
    Jan 10, 2004
    Messages:
    531
    Likes Received:
    0
    Trophy Points:
    16
    Instead of using a static error document, redirect errors to a script that detects the requested IP and serves up the appropriate page/message.
     
  3. johnnylu

    johnnylu Member

    Joined:
    Mar 17, 2004
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    I did alot of search but i still can't find a thread talking about this. Could you tell me where to find this kind of script?
    Thank you for your help! :)
     
  4. bamasbest

    bamasbest Well-Known Member

    Joined:
    Jan 10, 2004
    Messages:
    531
    Likes Received:
    0
    Trophy Points:
    16
  5. johnnylu

    johnnylu Member

    Joined:
    Mar 17, 2004
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    Could some one tell me what i did wrong with the code below:

    Options +FollowSymLinks
    RewriteEngine On
    RewriteCond %{remote_addr} ^xxx.xxx.xxx.xxx$
    RewriteRule ^index\.html$ /403.shtml [L]

    Thank you in advance!
     
  6. BrightAdmin

    BrightAdmin Well-Known Member

    Joined:
    Feb 29, 2004
    Messages:
    204
    Likes Received:
    0
    Trophy Points:
    16
    Hi,

    You can do this via rewrite rule in .htaccess.

    Hope this may help you.

    Regards,

    Bright:)
     
  7. johnnylu

    johnnylu Member

    Joined:
    Mar 17, 2004
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    I finally did it!
    Thank for your help! :D
     
Loading...

Share This Page