folgende situation: ich habe auf meinem webspace die datei
/datei.php
und den ordner
/datei/
liegen.
mit dieser .htaccess
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !\.php$ [NC]
RewriteRule ^(.*)$ $1.php [L]
schreibe ich zur zeit example.com/datei zu example.com/datei.php um. nun habe ich aber folgendes problem: wenn ich example.com/datei eingebe, zieht der scheinbar den ordner vor und öffnet diesen.
ich will aber, dass die datei „höhere priorität“ hat. ist das umsetzbar?
zb so, dass der ordner nur geöffnet wird, wenn ich ein slash am ende setze? example.com/datei/ und die datei bei example.com/datei
?
jo httpd.apache.org/docs/trunk/mod/ … ewritecond[quote=“http://httpd.apache.org/docs/trunk/mod/mod_rewrite.html#rewritecond”]You can perform various file attribute tests:
[ul] ‘-d’ (is directory)
Treats the TestString as a pathname and tests whether or not it exists, and is a directory.
’-f’ (is regular file)
Treats the TestString as a pathname and tests whether or not it exists, and is a regular file.
’-F’ (is existing file, via subrequest)
Checks whether or not TestString is a valid file, accessible via all the server’s currently-configured access controls for that path. This uses an internal subrequest to do the check, so use it with care - it can impact your server’s performance!
’-H’ (is symbolic link, bash convention)
See -l.
’-l’ (is symbolic link)
Treats the TestString as a pathname and tests whether or not it exists, and is a symbolic link. May also use the bash convention of -L or -h if there’s a possibility of confusion such as when using the -lt or -le tests.
’-L’ (is symbolic link, bash convention)
See -l.
’-s’ (is regular file, with size)
Treats the TestString as a pathname and tests whether or not it exists, and is a regular file with size greater than zero.
’-U’ (is existing URL, via subrequest)
Checks whether or not TestString is a valid URL, accessible via all the server’s currently-configured access controls for that path. This uses an internal subrequest to do the check, so use it with care - it can impact your server’s performance!
’-x’ (has executable permissions)
Treats the TestString as a pathname and tests whether or not it exists, and has executable permissions. These permissions are determined according to the underlying OS.[/ul]
[/quote]