RewriteEngine On

RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ - [L]

RewriteRule magazyn/^([^/]+)/?$ web/szafa/szafa.php?$1 [L,QSA]

ErrorDocument 400 /errordoc/400.html
ErrorDocument 401 /errordoc/401.html
ErrorDocument 403 /errordoc/403.html
ErrorDocument 404 /errordoc/404.html
ErrorDocument 500 /errordoc/500.html 