All pastes #727915 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-10-06 14:56 UTC
rendered paste body
I want to redirect example.com/subdir to example.com/index.php?strana=subdir - it has no problems, if subdir "subdir" does not exists. But if subdir exists, it displays page 403 - forbidden due to denied directory listing. How can I redirect example.com/subdir to example.com/index.php?strana=subdir, when subdir exists?


My .htaccess

RewriteCond %{REQUEST_URI} !^\/admin\/?$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\/].[^\/]*)$ %{DOCUMENT_ROOT}/?strana=$1 [L,QSA,T=application/x-httpd-php,NC]