Forum Moderators: phranque
RewriteEngine on
RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^/content\.jsp\?sectionId=11$ [my.com...] [L,R]
RewriteCond "%{REQUEST_FILENAME}"!awstatsicons
RewriteCond "%{REQUEST_FILENAME}"!j_security_check
RewriteCond "%{DOCUMENT_ROOT}%{REQUEST_FILENAME}"!-f
RewriteCond "%{DOCUMENT_ROOT}%{REQUEST_FILENAME}"!-d
RewriteRule ^(.*)$ /friendly.php?s=$1 [L,PT]
The problem happens when someone goes to http://my.com/dir or http://my.com/dir/. There's an index.html in some directories, but when a form is included with an iframe tag whose src attribute points to the directory and not the file directly, the last rule gets applied instead of just serving the directory index.
How can I adjust these rules so that directory indexes get served whenever they exist? It could be an index.html, default.htm, index.php, etc.
TIA!
Troy
[edited by: jdMorgan at 6:25 pm (utc) on Mar. 3, 2006]
[edit reason] De-linked. Obscured URLs [/edit]
So, these should be changed:
RewriteCond "%{DOCUMENT_ROOT}%{REQUEST_FILENAME}"!-f
RewriteCond "%{DOCUMENT_ROOT}%{REQUEST_FILENAME}"!-d
like this:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
Or like this:
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
(I don't think you really need double quotes.)