Jump to content

Error if no index in directory


Recommended Posts

Hi,

if i go in a directory without a file inderx, eg: https://laltroweb.it/test

i receive a loop redirect cause from this code by ipb in htaccess:

Quote

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule \.(js|css|jpeg|jpg|gif|png|ico)(\?|$) /404error.php [L,NC]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

 

if i remove, all work again (i receive a simple forbidden by my server - cause global "no directory index" in my root htaccess.

 

someone can help me to fix this? :|

 

thanks,

S.N.

Link to comment
Share on other sites

If you are on a server where you can control indexing, you might want to set your folder to "No Indexing" and see if that helps. You can control it through cPanel if you have that or through an .htaccess file.

Options are:
No Indexing
Standard Indexing (filename only)
Fancy Indexing (filename and description)

Link to comment
Share on other sites

like i've write:

Quote

if i remove, all work again (i receive a simple forbidden by my server - cause global "no directory index" in my root htaccess.

then, thanks for reply, but i already have  No Indexing in entire root ^_^

 

Link to comment
Share on other sites

Ok, fixed now ^_^

403error.php in root directory: (like default output server page and based on default 404error page from ipb)

<?php

header("HTTP/1.0 403 Forbidden");

$uri = $_SERVER["REQUEST_URI"]; 

print <<<EOF
<html>
	<title>403 Forbidden</title>
	<body>
		<h1>Forbidden</h1>
		<p>You dont have permission to access $uri on this server.</p>
		<p>Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.</p>
	</body>
</html>
EOF;

exit;

and:

ErrorDocument 403 /403error.php

in htaccess (at the end).

 

Now all is good ;)

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...