Closed Thread
Results 1 to 7 of 7

Thread: .htaccess not working prperly

  1. #1
    moneynetworkgroup39's Avatar
    moneynetworkgroup39 is offline x10Hosting Member moneynetworkgroup39 is an unknown quantity at this point
    Join Date
    Aug 2010
    Location
    In my dreams
    Posts
    90

    .htaccess not working prperly

    Hi I was trying to deny all ip for my website instead my ip so I tried to write .htacces. I wrote exactly like this
    PHP]order deny,allow
    deny from all
    allow from 192.168.*.*[/PHP]
    But from my ip also getting 403 forbidden tried by full ip address also but not working any thing.


    So, How to solve it?

  2. #2
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,635

    Re: .htaccess not working prperly

    They have a load balancing system and the IP address given to .htaccess is not the IP of the request.

    You have to somehow use the HTTP FORWARDED-FOR header information instead. I haven't seen a solution that has been verified as working (in .htaccess ... PHP files have a way of accessing the headers).
    Nothing is always absolutely so.

  3. #3
    moneynetworkgroup39's Avatar
    moneynetworkgroup39 is offline x10Hosting Member moneynetworkgroup39 is an unknown quantity at this point
    Join Date
    Aug 2010
    Location
    In my dreams
    Posts
    90

    Re: .htaccess not working prperly

    so what should I do now?

  4. #4
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,635

    Re: .htaccess not working prperly

    Why do you want to make your site totally private?
    Nothing is always absolutely so.

  5. #5
    moneynetworkgroup39's Avatar
    moneynetworkgroup39 is offline x10Hosting Member moneynetworkgroup39 is an unknown quantity at this point
    Join Date
    Aug 2010
    Location
    In my dreams
    Posts
    90

    Re: .htaccess not working prperly

    Last time my site almost hacked and I am wring a new script so I have to test so I want to keep open it for me and closed for every body to avoid hack attempt because I can not administrate and write script together.

  6. #6
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,635

    Re: .htaccess not working prperly

    At the top of any PHP script, test

    $_ENV[ 'HTTP_X_FORWARDED_FOR' ] or $_ENV[ 'HTTP_X_REAL_IP' ]

    If it isn't yours, just redirect them to a stock "Welcome" page.
    Nothing is always absolutely so.

  7. #7
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,635

    Re: .htaccess not working prperly

    If you are not using PHP, and have to use .htaccess:

    RewriteCond %{HTTP:X-Forwarded-For} !^133\.66\.13\.78$
    RewriteRule ^(.*)$ youarenotwelcome.html [L]

    Replace the IP with yours and the rewrite to a page kindly notifying them that access is denies.

    Works on an account on Chopin.

    Remember that x10hosting accounts are for websites.
    Nothing is always absolutely so.

Closed Thread

Similar Threads

  1. .htaccess is not working.
    By walz.raymond66 in forum Free Hosting
    Replies: 4
    Last Post: 03-23-2011, 08:41 PM
  2. htaccess changes
    By christiand14 in forum Free Hosting
    Replies: 1
    Last Post: 11-13-2010, 12:21 PM
  3. Replies: 3
    Last Post: 02-11-2010, 02:09 PM
  4. .htaccess
    By alijx1 in forum Free Hosting
    Replies: 4
    Last Post: 12-23-2009, 03:15 PM
  5. .htaccess RewriteRules not working?
    By Skizzerz in forum Free Hosting
    Replies: 0
    Last Post: 08-23-2008, 11:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers