.htaccess Dir Listing Only Redirect
Posted: Tue Apr 24, 2007 10:04 am
Hello All,
Put simply I want to use redirect only when on the Directory listing to the home page when in a sub-directory where the .htaccess used to be RewriteEngine off and the root directory points everything to a specific php script (Zend Framework setup).
The directory and .htaccess files are as follows
The root/.htaccess is
Under the public directory with the aid of Google I changed the .htaccess to, rather than just "RewriteEngine off":
I then get a error 500 when trying to view the directory without any file information. What I really want to do is redirect to the index.php at the top level if directory listing but allow any files access if referenced directly. I need to "ignore" any redirects defined in the initial .htaccess.
Hopefully this makes sense and someone has come across the problem/solution before. If they can either give me a solution or point me in the right direction (and I don't mean the apache .htaccess documentation as I have looked at that already and come away more confused than ever
).
Thanks in advance
Put simply I want to use redirect only when on the Directory listing to the home page when in a sub-directory where the .htaccess used to be RewriteEngine off and the root directory points everything to a specific php script (Zend Framework setup).
The directory and .htaccess files are as follows
Code: Select all
Root
.htaccess
application directory
public directory
.htaccessCode: Select all
RewriteEngine on
RewriteBase /~user/application
RewriteRule !\.(js|ico|gif|jpg|png|css)$ index.phpCode: Select all
RewriteEngine off
Options -IndexesHopefully this makes sense and someone has come across the problem/solution before. If they can either give me a solution or point me in the right direction (and I don't mean the apache .htaccess documentation as I have looked at that already and come away more confused than ever
Thanks in advance