Apache "Option -Indexes" and 404 Not Found  | 
	 
	 
![]() ![]()  | 
	
Apache "Option -Indexes" and 404 Not Found  | 
	 
	 
			
			  Feb 17 2010, 11:47 PM
			
				 Post
					#1
					
				
			 
		 | 
	|
        	
				
					![]() Senior Member ![]() ![]() ![]() ![]() ![]() ![]() Group: Administrator Posts: 2,648 Joined: Apr 2008 Member No: 639,265  | 
       
			
			 
				On my website, I have directory listings disabled via an "Options -Indexes" line in my .htaccess file. However, requests for directories that do not have an index.html file return 403 Forbidden. Is there a way to have it return 404 Not Found instead?
				
				
				
			 
			
			
					
		 | 
	
| 
			
			 | 
	|
			
			  Feb 18 2010, 01:45 AM
			
				 Post
					#2
					
				
			 
		 | 
	|
| 
        	
				
        			 Senior Member ![]() ![]() ![]() ![]() ![]() ![]() Group: Member Posts: 1,237 Joined: May 2008 Member No: 648,123  | 
       
			
			 
				Do you specifically need a 404 response? If not, you could just send 403 errors to a custom 404 error document.
				
				
				
			 
			
			
					
		 | 
	
| 
			
			 | 
	|
			
			  Feb 18 2010, 08:19 AM
			
				 Post
					#3
					
				
			 
		 | 
	|
        	
				
					![]() Senior Member ![]() ![]() ![]() ![]() ![]() ![]() Group: Administrator Posts: 2,648 Joined: Apr 2008 Member No: 639,265  | 
       
			
			 
				That's what I'm doing, but I would like to return 404 instead of 403.
				
				
				
			 
			
			
					
		 | 
	
| 
			
			 | 
	|
			
			  Feb 19 2010, 12:38 AM
			
				 Post
					#4
					
				
			 
		 | 
	|
| 
        	
				
        			 Senior Member ![]() ![]() ![]() ![]() ![]() ![]() Group: Member Posts: 1,237 Joined: May 2008 Member No: 648,123  | 
       
			
			 
				Hrm, no idea. Apache's one of my more prominent weaknesses. 
			
			
					
		You can try looking around forum.modrewrite.com. The guy who runs it is a master of regex, and I'm sure he would know the various ins and outs of manipulating status codes.  | 
	
| 
			
			 | 
	|
			
			  Apr 2 2010, 01:00 PM
			
				 Post
					#5
					
				
			 
		 | 
	|
        	
				
					![]() Senior Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Administrator Posts: 8,629 Joined: Jan 2007 Member No: 498,468  | 
       
			
			 
				Topic Closed, and Moved to Resolved Topics. Please PM a moderator if you would like this reopened.
				
				
				
			 
			
			
					
		 | 
	
| 
			
			 | 
	|
![]() ![]()  |