VIP, вот мой код файла
.htaccess
RewriteEngine on
php_value magic_quotes_gpc 0
php_value default_charset utf-8
AddDefaultCharset UTF-8
Addtype text/x-url .url
Addtype image/jpeg .jpg
Addtype image/jpeg .jpeg
Addtype image/gif .gif
Addtype image/png .png
Addtype image/bmp .bmp
# переопределяем страницы ошибок
ErrorDocument 400 /err.php?err=400
ErrorDocument 401 /err.php?err=401
ErrorDocument 402 /err.php?err=402
ErrorDocument 403 /err.php?err=403
ErrorDocument 404 /err.php?err=404
ErrorDocument 500 /err.php?err=500
ErrorDocument 502 /err.php?err=502
RewriteEngine On
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^(www\\.)?gefan\\.ru$ [NC]
RewriteCond %{HTTP_HOST}---%{REQUEST_URI} ^([^\\.]+)\\.gefan\\.ru---/([^/]+)? [NC]
RewriteCond %1---%2 !^(.*)---\\1$ [NC]
RewriteRule ^(.*)$
http://seclub.mobi/!%1$1 [R=301,L]
RewriteRule ^!(.*)$ /info.php?u=$1
RewriteRule ^id([0-9]+)$ /info.php?id=$1