Forum Moderators: phranque
i was wondering whats wrong with this :
RewriteCond $1 !-d
RewriteCond $1 !-f
RewriteRule ^([a-zA-Z0-9_.]{4,32})/?$ file.php?s=$1 [L]
i want this works for every request except the ones that are actually exists...
for example something like :
domain.com/favicon.ico (which exists on the domain) redirect it to file.php which i dnt want to
any ideas ?
The URL-path will never contain the full filesystem path, for example "/var/www/public/html/script.php"
You will at least need to prepend the documentroot filepath for this to work. For example:
RewriteCond %{DOCUMENT_ROOT}/$1 !-f
RewriteCond %{DOCUMENT_ROOT}/$1 !-d
RewriteCond %{DOCUMENT_ROOT}/$1 !-f
RewriteRule ^([a-zA-Z0-9_.]{4,32})/?$ http://example.com/file.php?s=$1&[i]checkpath=%{DOCUMENT_ROOT}/$1[/i] [R=302,L]