1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Help needed on Apache .htaccess ErrorDocument

Discussion in 'Apache' started by greengameplayer, Dec 6, 2019.

  1. #1
    (please excuse my broken apostrophe key, it shows up as ´)
    I have two entries in my root .htaccess . They are:
    ErrorDocument 403.4 /error_pages/403.4.html
    ErrorDocument 403.6 /error_pages/403.6.html

    Any time a 403 error is produced it always gives the 403.4 error page. I don´t think I am doing anything wrong, please help.
    SEMrush
     
    greengameplayer, Dec 6, 2019 IP
    SEMrush
  2. RoseHosting

    RoseHosting Well-Known Member

    Messages:
    222
    Likes Received:
    11
    Best Answers:
    11
    Trophy Points:
    138
    #2
    403.4 and 403.6 are HTTP status codes in IIS, not in Apache web server. You should use the following line in the .htaccess file instead:
    ErrorDocument 403 /error_pages/403.html
    Code (markup):
     
    RoseHosting, Dec 7, 2019 IP
  3. greengameplayer

    greengameplayer Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #3
    The problem is I need different error pages for the different errors - One is for when your ip is not whitelisted, one if you are not using SSL. I figured a workaround though - I made a seperate page for the one tree on my site - 403.6-sec.html - and have that be displayed for a 403. That page has javascript script that runs on page load that detects if the browser URL has https in it. If it doesn't it redirects to 404.4.html. It's not perfect, but it works.
     
    greengameplayer, Dec 8, 2019 IP