Change internally 403 Error to 404 Error


 
Thread Tools Search this Thread
Top Forums Web Development Change internally 403 Error to 404 Error
# 1  
Old 11-15-2010
Change internally 403 Error to 404 Error

I have the htaccess file within the folder in the domain I want to deny access to all users, execept one IP, after that
redirects Error 403 resulting to a 404 error custom html page as shown below.
Code:
# Restringting access!
deny from all
allow from 204.127.111.105     # Example of allowed IP
ErrorDocument 403 /404.shtml  # Redirecting error 403 to error 404 page

I would like to change 403 Error and redirect to an internal 404 Error, Or, avoid the generation of 403 Error code and redirects
only to the 404Error.html custom page without any user could know that has been redirected from an original 403 Error.

I`ve tried with the code below but it shows a 403 error and the RewriteRule looks like doesn´t have any effect in the code.
Code:
# Restringting access!
deny from all
allow from 204.127.111.105     # Example of allowed IP
RewriteCond %{REMOTE_ADDR} ^205\.127\.127\.252  #Testing for 1 IP, 
RewriteRule ^(.*)$ /test.jpg [L]

May somebody help me with this issue?

Thanks in advance for any suggestion.
# 2  
Old 11-17-2010
What does the web server log file say about this?

---------- Post updated at 00:57 ---------- Previous update was at 00:52 ----------

Also,, you might want to have a look at this:

International Customized Server Error Messages

... and more importantly:

ErrorDocument Directive
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Spacewalk repodata/repomd.xml [Errno 14] HTTP Error 404 - Not Found

I Configured spacwalk 2.7 and synchronized the channels as the root FS was and the server was unresponsive through gui i deleted the cache in /var/cache/rhn & /var/cache/yum and ran yum clean all on the server as well as spacewalk client i could see the following error Loaded plugins: rhnplugin... (0 Replies)
Discussion started by: James0806
0 Replies

2. Web Development

How to log http 404 error to a separate log file?

Apache Web Server: how to log http 404 error to a separate log file and i do not want to log in access.log please advice. (2 Replies)
Discussion started by: raghur77
2 Replies

3. Red Hat

HTTP/1.1 404 Not Found error in Web Server

I am running 2 jboss instances with ports 8585 and 8686 in my web server. Now trying to get header using the command curl -s --connect-timeout 360 -m 360 --head http: // localhost:8686/ then i get the following error HTTP/1.1 404 Not Found Server: Apache-Coyote/1.1 Content-Length: 0... (1 Reply)
Discussion started by: hridan
1 Replies

4. Red Hat

Cant update yum what so ever [Errno 14] HTTP Error 404 - Not Found

Hello!!! I am so frustrated I'm about to snap!!! I cant hear any sound in Firefox or re-install Chrome. Every time I try to do anything with YUM inside my terminal (like update or install) I keep getting this error:failure: repodata/repomd.xml from virtualbox: No more mirrors to try. I... (2 Replies)
Discussion started by: ApacheOmega
2 Replies

5. Shell Programming and Scripting

Change directory error

bash ~/match.sh runs fine. #!/bin/bash printf "Enter ID : "; read id printf "What panel: "; read panel cd 'C:\Users\cmccabe\Desktop\annovar' && break && break OMR=Output_Mutation_Report perl -aF/\\t/ -lne... (13 Replies)
Discussion started by: cmccabe
13 Replies

6. Shell Programming and Scripting

Wget-403-Forbidden-Error

Hi Friends, I did an extensive search over the internet and tried all possible solutions that were recommended, but couldn't figure this out. Please see this link http://www.dli.gov.in/data6/upload/0159/808/PTIFF/00000007.tif It works. But, when I try the following command wget -r... (7 Replies)
Discussion started by: jacobs.smith
7 Replies

7. Web Development

[.htaccess] Denegar IP Con Error 404

Saludos amigos programadores de Web. Mi Problema es, que necesito denegar una IP desde el fichero .htaccess, pero no con el tipico error 403 (Forbidden). sino con el error 404 (Not found). Para quitarme de encima una IP fija que visita constantemente mi servidor para llenar de Spam mis... (1 Reply)
Discussion started by: Ignacio A
1 Replies

8. Web Development

HTTP 404 Error Fetches File from Another Server

Has any seen any PHP or other scripting code that will executive on a 404 "File Not Found' error and then fetch the requested file from a different server? (0 Replies)
Discussion started by: Neo
0 Replies

9. AIX

Issue "Error 404" when upgrade AIX 5300-05-CSP-0000 to AIX (5300-09-02-0849)

Please read my issue! My old server using: - AIX system operating (5300-05-CSP-0000) - WebSphere 6.1.0.21 (Fix Pack 21) After I've upgraded version AIX - AIX system operating (5300-09-02-0849) - WebSphere 6.1.0.21 (Fix Pack 21) I have 1 issue when I access home page: "Error... (0 Replies)
Discussion started by: gamonhon
0 Replies

10. UNIX for Advanced & Expert Users

403 Error in Apache?

I have installed Apache lots of times before. I have recently installed apache on FreeBSD. And it gives me all the time 403 Frobidden - you don't have permittion to access / directory. I have checked permitions. I've got -rwxrwxr-x for for all Apache DocumentRoot. I've checked Files directive in... (6 Replies)
Discussion started by: solvman
6 Replies
Login or Register to Ask a Question