Solved

NGINX/Apache redirect on 403 and 404

Posted on 2016-10-28
5
39 Views
Last Modified: 2016-11-05
Any idea how to redirect to home page on 403 & 404 errors in NGINX with Apache?  PHP-FPM is enabled but seems to still follow apache directives if that makes difference.
0
Comment
Question by:tf2012
  • 3
  • 2
5 Comments
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
Make an error page that does it.  This is in my .htaccess page for Apache.  I don't know what nginx requires.
ErrorDocument 400 /400.html
ErrorDocument 401 /401.html
ErrorDocument 403 /403.html
ErrorDocument 404 /404.html
ErrorDocument 500 /500.html

Open in new window

1
 
LVL 1

Author Comment

by:tf2012
Comment Utility
it seems to process .htaccess for some reason so I'll give this a shot today.  Thanks!
0
 
LVL 1

Author Comment

by:tf2012
Comment Utility
@Dave what if I want to redirect the 403 to another domain? How would you do that in htaccess?

for example I'm blocking certain ip addresses, the get 403 error, great.. but I want them to redirect to www.mydomain.com for example instead of getting the 403 error.
0
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 500 total points
Comment Utility
Just do the redirect in the 403 error page.  You can make it say whatever you want.  They don't have to know they got there because of an error.
0
 
LVL 1

Author Closing Comment

by:tf2012
Comment Utility
great idea thanks
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
If, like me, you have a lot of Dell servers in the estate you manage this article should save you a little time. When attempting to login to iDrac on any server I would be presented with two errors. The first reads "Do you want to run this applicati…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now