www.webdeveloper.com
Results 1 to 2 of 2

Thread: Anyway to have HTACCESS return 200 status code after a 403 block?

  1. #1
    Join Date
    Jul 2009
    Posts
    11

    Anyway to have HTACCESS return 200 status code after a 403 block?

    I am using htaccess to block an ip address via the "deny from #.#.#.#"...i also use the "ErrorDocument 403 /page.htm" to show the user a different page. However, when i do this the user gets back a 403 status code...is there a way to return back a 200 status code and still show the page....ideally i dont want the user to get back a 403 status code when the page content is returned.

    Thanks

  2. #2
    Join Date
    Apr 2010
    Posts
    213
    Instead of denying #.#.#.#, you could probably use a rewrite rule based on the address. Something like this, maybe:

    Code:
    RewriteCond %(REMOTE_ADDR)	^#.#.#.#
    RewriteRule ^/$			/redirectedpage.html
    Try it out on a test server first... I'm not much of an expert at .htaccess files, etc.
    Good luck

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles