Пост viiprogrammer - сообщение в Denwer был отмечен как ответ
25 февраля, 2016
Замени на
DirectoryIndex index.php
AddDefaultCharset windows-1251
RewriteEngine On
# Optimize deflate
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css application/x-javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch bMSIE !no-gzip !gzip-only-text/html
# Accses in folder
Options All -Indexes
# Loading Errors
ErrorDocument 401 /ups/401.php
ErrorDocument 403 /ups/403.php
ErrorDocument 404 /ups/404.php
ErrorDocument 500 /ups/500.php
# Отключаем вывод ошибок пользователям
php_flag display_errors off
# Регистрация
RewriteRule ^reg/(/?)+$ index.php?go=register [L]
# Страница юзера
RewriteRule ^u([0-9]+)(/?)+$ index.php?go=profile&id=$1 [L]
RewriteRule ^u([0-9]+)after(/?)+$ index.php?go=profile&id=$1&after=1 [L]
# Редактирование страницы
RewriteRule ^editmypage(/?)+$ index.php?go=editprofile [L]
RewriteRule ^editmypage/contact(/?)+$ index.php?go=editprofile&act=contact [L]
RewriteRule ^editmypage/interests(/?)+$ index.php?go=editprofile&act=interests [L]
RewriteRule ^editmypage/all(/?)+$ index.php?go=editprofile&act=all [L]
# Альбомы в группах
RewriteRule ^albums-([0-9]+)(/?)+$ index.php?go=groups_albums&uid=$1 [L]
RewriteRule ^albums-([0-9]+)_([0-9]+)/add(/?)+$ index.php?go=groups_albums&act=add&aid=$2&pid=$1 [L]
RewriteRule ^albums-([0-9]+)_([0-9]+)(/?)+$ index.php?go=groups_albums&act=view&aid=$2&pid=$1 [L]
RewriteRule ^albums-([0-9]+)_([0-9]+)/page/([0-9]+)(/?)+$ index.php?go=groups_albums&act=view&aid=$2&page=$3&pid=$1 [L]
RewriteRule ^albums-([0-9]+)/comments(/?)+$ index.php?go=groups_albums&act=all_comments&uid=$1 [L]
RewriteRule ^albums-([0-9]+)/comments/page/([0-9]+)(/?)+$ index.php?go=groups_albums&act=all_comments&uid=$1&page=$3 [L]
RewriteRule ^albums-([0-9]+)_([0-9]+)/comments(/?)+$ index.php?go=groups_albums&act=all_comments&aid=$2&pid=$1 [L]
RewriteRule ^albums-([0-9]+)_([0-9]+)/comments/page/([0-9]+)(/?)+$ index.php?go=groups_albums&act=all_comments&aid=$2&page=$2&pid=$1 [L]
RewriteRule ^albums-([0-9]+)/editphotos/([0-9]+)(/?)+$ index.php?go=groups_albums&act=edit_pos_photos&aid=$2&pid=$1 [L]
RewriteRule ^albums-([0-9]+)/newphotos(/?)+$ index.php?go=groups_albums&act=new_photos&pid=$1 [L]
RewriteRule ^albums-([0-9]+)/newphotos/([0-9]+)(/?)+$ index.php?go=groups_albums&act=new_photos&page=$2&pid=$1 [L]
# Просмотр фото в группах
RewriteRule ^photo-([0-9]+)_([0-9]+)_([0-9]+)(/?)+$ index.php?go=groups_albums&act=view&pid=$1&aid=$3 [L]
# Альбомы
RewriteRule ^albums/([0-9]+)(/?)+$ index.php?go=albums&uid=$1 [L]
RewriteRule ^albums/add/([0-9]+)(/?)+$ index.php?go=albums&act=add&aid=$1 [L]
RewriteRule ^albums/view/([0-9]+)(/?)+$ index.php?go=albums&act=view&aid=$1 [L]
RewriteRule ^albums/view/([0-9]+)/page/([0-9]+)(/?)+$ index.php?go=albums&act=view&aid=$1&page=$2 [L]
RewriteRule ^albums/comments/([0-9]+)(/?)+$ index.php?go=albums&act=all_comments&uid=$1 [L]
RewriteRule ^albums/comments/([0-9]+)/page/([0-9]+)(/?)+$ index.php?go=albums&act=all_comments&uid=$1&page=$2 [L]
RewriteRule ^albums/view/([0-9]+)/comments/(/?)+$ index.php?go=albums&act=all_comments&aid=$1 [L]
RewriteRule ^albums/view/([0-9]+)/comments/page/([0-9]+)(/?)+$ index.php?go=albums&act=all_comments&aid=$1&page=$2 [L]
RewriteRule ^albums/editphotos/([0-9]+)(/?)+$ index.php?go=albums&act=edit_pos_photos&aid=$1 [L]
RewriteRule ^albums/newphotos(/?)+$ index.php?go=albums&act=new_photos [L]
RewriteRule ^albums/newphotos/([0-9]+)(/?)+$ index.php?go=albums&act=new_photos&page=$1 [L]
# Просмотр фотографий
RewriteRule ^photo([0-9]+)_([0-9]+)_sec=user_page(/?)+$ index.php?go=profile&id=$1 [L]
RewriteRule ^photo([0-9]+)_([0-9]+)_sec=all_comments(/?)+$ index.php?go=albums&act=all_comments&uid=$1 [L]
RewriteRule ^photo([0-9]+)_([0-9]+)_sec=wall/fuser=([0-9]+)(/?)+$ index.php?go=profile&id=$3 [L]
RewriteRule ^photo([0-9]+)_([0-9]+)_sec=notes/id=([0-9]+)(/?)+$ index.php?go=notes&act=view¬e_id=$3 [L]
RewriteRule ^photo([0-9]+)_([0-9]+)_sec=news(/?)+$ index.php?go=news [L]
RewriteRule ^photo([0-9]+)_([0-9]+)_sec=msg/id=([0-9]+)(/?)+$ index.php?go=messages&act=review&mid=$3 [L]
RewriteRule ^photo([0-9]+)_([0-9]+)_([0-9]+)(/?)+$ index.php?go=albums&act=view&aid=$3 [L]
RewriteRule ^photo([0-9]+)_([0-9]+)_([0-9]+)_sec=album_comments(/?)+$ index.php?go=albums&act=all_comments&aid=$3 [L]
RewriteRule ^photo([0-9]+)_([0-9]+)_([0-9]+)_sec=newphotos(/?)+$ index.php?go=albums&act=new_photos [L]
RewriteRule ^chat /index.php?go=chat [L]
# Работа
RewriteRule ^jobs(/?)+$ index.php?go=jobs [L]
RewriteRule ^jobs/news_all(/?)+$ index.php?go=jobs&act=news_all [L]
RewriteRule ^jobs/my_news_jobs/user_id/([0-9]+)(/?)+$ index.php?go=jobs&act=my_news_jobs&user_id=$1 [L]
RewriteRule ^jobs/news_adds(/?)+$ index.php?go=jobs&act=news_adds [L]
RewriteRule ^jobs/resume_create(/?)+$ index.php?go=jobs&act=resume_create [L]
RewriteRule ^jobs/news_all/page/([0-9]+)(/?)+$ /index.php?go=jobs&act=news_all&page=$1 [L]
RewriteRule ^jobs/news_wiev_all/id/([0-9]+)(/?)+$ /index.php?go=jobs&act=news_wiev_all&id=$1 [L]
# Карту
RewriteRule ^ajax_mapsBox([0-9]+)(/?)$ index.php?go=mapsbox&act=mapsbox&id=$1 [L]
RewriteRule ^ajax_mapsSend([0-9]+)(/?)$ index.php?go=mapsbox&act=send&id=$1
RewriteRule ^maps_travel(/?)+$ index.php?go=mapsbox&act=maps_travel [L]
# Потверждение групп пользователя
RewriteRule ^confirmation/confirm_wiev(/?)+$ index.php?go=confirmation&act=confirm_wiev [L]
RewriteRule ^confirmation/confirm_wiev/page/([0-9]+)(/?)+$ index.php?go=confirmation&act=confirm_wiev&page=$1 [L]
RewriteRule ^confirmation/verification_wiev(/?)+$ index.php?go=confirmation&act=verification_wiev [L]
RewriteRule ^confirmation/verification_wiev/page/([0-9]+)(/?)+$ index.php?go=confirmation&act=verification_wiev&page=$1 [L]
RewriteRule ^confirmation/jobs_wiev(/?)+$ index.php?go=confirmation&act=jobs_wiev [L]
RewriteRule ^confirmation/jobs_wiev/page/([0-9]+)(/?)+$ index.php?go=confirmation&act=jobs_wiev&page=$1 [L]
# Друзья
RewriteRule ^friedns/send_demand/([0-9]+)(/?)+$ index.php?go=friends&act=send_demand&for_user_id=$1 [L]
RewriteRule ^friedns/take/([0-9]+)(/?)+$ index.php?go=friends&act=take&take_user_id=$1 [L]
RewriteRule ^friedns/reject/([0-9]+)(/?)+$ index.php?go=friends&act=reject&reject_user_id=$1 [L]
RewriteRule ^friends(/?)+$ index.php?go=friends [L]
RewriteRule ^friends/([0-9]+)(/?)+$ index.php?go=friends&user_id=$1 [L]
RewriteRule ^friends/([0-9]+)/page/([0-9]+)(/?)+$ index.php?go=friends&user_id=$1&page=$2 [L]
RewriteRule ^friends/online/([0-9]+)(/?)+$ index.php?go=friends&act=online&user_id=$1 [L]
RewriteRule ^friends/online/([0-9]+)/page/([0-9]+)(/?)+$ index.php?go=friends&act=online&user_id=$1&page=$2 [L]
RewriteRule ^friends/requests(/?)+$ index.php?go=friends&act=requests [L]
RewriteRule ^friends/requests/page/([0-9]+)(/?)+$ index.php?go=friends&act=requests&page=$1 [L]
RewriteRule ^friends/common/([0-9]+)(/?)+$ index.php?go=friends&act=common&uid=$1 [L]
RewriteRule ^friends/common/([0-9]+)/page/([0-9]+)(/?)+$ index.php?go=friends&act=common&uid=$1&page=$2 [L]
# Закладки
RewriteRule ^fave(/?)+$ index.php?go=fave [L]
RewriteRule ^fave/page/([0-9]+)(/?)+$ index.php?go=fave&page=$1 [L]
RewriteRule ^miss/([0-9]+)(/?)+$ index.php?go=miss&act=page&id=$1 [L]
RewriteRule ^miss(/?)+$ index.php?go=miss&act=top [L]
RewriteRule ^mister/([0-9]+)(/?)+$ index.php?go=mister&act=page&id=$1 [L]
RewriteRule ^mister(/?)+$ index.php?go=mister&act=top [L]
RewriteRule ^tv(/?)+$ index.php?go=tv [L]
RewriteRule ^yps /index.php?go=app [L]
RewriteRule ^kino(/?)+$ /index.php?go=app&act=kino [L]
RewriteRule ^photoshop(/?)+$ /index.php?go=app&act=photoshop [L]
# Отзывы
RewriteRule ^review(/?)+$ index.php?go=review [L]
RewriteRule ^review&page=([0-9]+)(/?)+$ index.php?go=review&page=$1 [L]
# Заметки
RewriteRule ^notes(/?)+$ index.php?go=notes [L]
RewriteRule ^notes/add(/?)+$ index.php?go=notes&act=add [L]
RewriteRule ^notes/edit/([0-9]+)(/?)+$ index.php?go=notes&act=edit¬e_id=$1 [L]
RewriteRule ^notes/view/([0-9]+)(/?)+$ index.php?go=notes&act=view¬e_id=$1 [L]
RewriteRule ^notes/([0-9]+)(/?)+$ index.php?go=notes&get_user_id=$1 [L]
RewriteRule ^notes/([0-9]+)/page/([0-9]+)(/?)+$ index.php?go=notes&get_user_id=$1&page=$2 [L]
# Видео
RewriteRule ^videos(/?)+$ index.php?go=videos [L]
RewriteRule ^videos/([0-9]+)(/?)+$ index.php?go=videos&get_user_id=$1 [L]
RewriteRule ^videos/([0-9]+)/page/([0-9]+)(/?)+$ index.php?go=videos&get_user_id=$1&page=$2 [L]
RewriteRule ^videos/([0-9]+)(/?)+$ index.php?go=videos&get_user_id=$1 [L]
RewriteRule ^video([0-9]+)_([0-9]+)(/?)+$ index.php?go=videos&get_user_id=$1 [L]
RewriteRule ^video([0-9]+)_([0-9]+)_sec=wall/fuser=([0-9]+)(/?)+$ index.php?go=profile&id=$3 [L]
RewriteRule ^video([0-9]+)_([0-9]+)_sec=notes/id=([0-9]+)(/?)+$ index.php?go=notes&act=view¬e_id=$3 [L]
RewriteRule ^video([0-9]+)_([0-9]+)_sec=news(/?)+$ index.php?go=news [L]
RewriteRule ^video([0-9]+)_([0-9]+)_sec=msg/id=([0-9]+)(/?)+$ index.php?go=messages&act=review&mid=$3 [L]
# Поиск
RewriteRule ^search/query=(.*)&type=([0-3]+)(/?)+$ index.php?go=search&query=$1&type=$2 [L]
# Новости
RewriteRule ^news(/?)+$ index.php?go=news [L]
RewriteRule ^news/updates(/?)+$ index.php?go=news&type=updates [L]
RewriteRule ^news/photos(/?)+$ index.php?go=news&type=photos [L]
RewriteRule ^news/videos(/?)+$ index.php?go=news&type=videos [L]
RewriteRule ^news/notifications(/?)+$ index.php?go=news&type=notifications [L]
# Сообщения
RewriteRule ^messages(/?)+$ index.php?go=messages [L]
RewriteRule ^messages/i(/?)+$ index.php?go=messages&info=1 [L]
RewriteRule ^messages/outbox(/?)+$ index.php?go=messages&act=outbox [L]
RewriteRule ^messages/show/([0-9]+)(/?)+$ index.php?go=messages&act=review&mid=$1 [L]
# Стена
RewriteRule ^wall([0-9]+)(/?)+$ index.php?go=wall&uid=$1&type=page [L]
RewriteRule ^wall([0-9]+)/page/([0-9]+)(/?)+$ index.php?go=wall&uid=$1&type=page&page=$2 [L]
RewriteRule ^wall([0-9]+)_sec=own(/?)+$ index.php?go=wall&uid=$1&type=own [L]
RewriteRule ^wall([0-9]+)_sec=own&page=([0-9]+)(/?)+$ index.php?go=wall&uid=$1&type=own&page=$2 [L]
RewriteRule ^wall([0-9]+)_([0-9]+)(/?)+$ index.php?go=wall&uid=$1&rid=$2&type=record [L]
# Настройки
RewriteRule ^settings(/?)+$ index.php?go=settings [L]
RewriteRule ^settings/privacy(/?)+$ index.php?go=settings&act=privacy [L]
RewriteRule ^settings/blacklist(/?)+$ index.php?go=settings&act=blacklist [L]
RewriteRule ^settings/design(/?)+$ index.php?go=settings&act=design [L]
RewriteRule ^settings/notify(/?)+$ index.php?go=settings&act=notify [L]
# Помощь
RewriteCond %{QUERY_STRING} ^act=([a-z]+)
RewriteRule ^(.*)support $1index.php?go=support [QSA,L]
RewriteCond %{QUERY_STRING} ^page=([0-9]+)
RewriteRule ^(.*)support $1index.php?go=support [QSA,L]
RewriteRule ^support(/?)+$ index.php?go=support [L]
# Воостановление пароля
RewriteCond %{QUERY_STRING} ^act=([a-z]+)
RewriteRule ^(.*)restore $1index.php?go=restore [QSA,L]
RewriteRule ^restore(/?)+$ index.php?go=restore [L]
# Блог сайта
RewriteCond %{QUERY_STRING} ^act=([a-z]+)
RewriteRule ^(.*)blog $1index.php?go=blog [QSA,L]
RewriteCond %{QUERY_STRING} ^id=([0-9]+)
RewriteRule ^(.*)blog $1index.php?go=blog [QSA,L]
RewriteRule ^blog(/?)+$ index.php?go=blog [L]
# UBM
RewriteCond %{QUERY_STRING} ^act=([a-z]+)
RewriteRule ^(.*)balance $1index.php?go=balance [QSA,L]
RewriteRule ^balance(/?)+$ index.php?go=balance [L]
# WEBTOMAT
RewriteCond %{QUERY_STRING} ^act=([a-z]+)
RewriteRule ^(.*)webtomat $1index.php?go=webtomat [QSA,L]
RewriteRule ^webtomat(/?)+$ index.php?go=webtomat [L]
# Розыгрыши
RewriteCond %{QUERY_STRING} ^act=([a-z]+)
RewriteRule ^(.*)loto $1index.php?go=nonsense [QSA,L]
RewriteRule ^loto(/?)+$ index.php?go=nonsense [L]
# Реф. ссылка на регистрацию
RewriteRule ^reg([0-9]+)(/?)+$ index.php?reg=$1 [L]
# Подарки
RewriteCond %{QUERY_STRING} ^new=([0-9]+)
RewriteRule ^(.*)gifts([0-9]+) $1index.php?go=gifts&uid=$2 [QSA,L]
RewriteCond %{QUERY_STRING} ^page=([0-9]+)
RewriteRule ^(.*)gifts([0-9]+) $1index.php?go=gifts&uid=$2 [QSA,L]
RewriteRule ^gifts([0-9]+)(/?)+$ index.php?go=gifts&uid=$1 [L]
# Сообщества
RewriteCond %{QUERY_STRING} ^act=([a-z]+)
RewriteRule ^(.*)groups $1index.php?go=groups [QSA,L]
RewriteCond %{QUERY_STRING} ^page=([0-9]+)
RewriteRule ^(.*)groups $1index.php?go=groups [QSA,L]
RewriteRule ^groups(/?)+$ index.php?go=groups [L]
RewriteRule ^wallgroups([0-9]+)_([0-9]+)(/?)+$ index.php?go=groups&act=wallgroups&pid=$1&id=$2 [L]
# Музыка
RewriteRule ^audio(/?)+$ index.php?go=audio [L]
RewriteRule ^audio([0-9]+)(/?)+$ index.php?go=audio&uid=$1 [L]
# Документы
RewriteRule ^docs(/?)+$ index.php?go=doc&act=list [L]
RewriteRule ^chat /index.php?go=chat [L]
# Соц.сети
RewriteRule ^mysocial(/?)+$ index.php?go=social [L]
# Игры
RewriteRule ^apps(/?)+$ index.php?go=apps [L]
RewriteRule ^app([0-9]+)(/?)+$ index.php?go=apps&act=start&id=$1 [L]
RewriteRule ^addapp(/?)+$ index.php?go=apps&act=add [L]
# Apps
RewriteRule ^game(/?)$ index.php?go=game [L]
RewriteRule ^recomend(/?)$ index.php?go=recomend [L]
RewriteRule ^game/page/([0-9+])(/?)$ index.php?go=game&page=$1 [L]
RewriteRule ^game/([0-9]+)(/?)$ index.php?go=game&about_app=$1 [L,QSA]
# Сообщества -> Публичные страницы -> Аудио
RewriteRule ^public/audio([0-9]+)(/?)+$ index.php?go=public_audio&pid=$1 [L]
# Сообщества -> Публичные страницы -> Видео
RewriteRule ^public/videos([0-9]+)(/?)+$ index.php?go=public_videos&pid=$1 [L]
# Моя реклама
RewriteRule ^mybanners(/?)+$ index.php?go=mybanners [L]
# Сообщества -> Публичные страницы -> Обсуждения
RewriteCond %{QUERY_STRING} ^act=([a-z]+)
RewriteRule ^(.*)forum([0-9]+) $1index.php?go=groups_forum&public_id=$2 [QSA,L]
RewriteCond %{QUERY_STRING} ^page=([0-9]+)
RewriteRule ^(.*)forum([0-9]+) $1index.php?go=groups_forum&public_id=$2 [QSA,L]
RewriteRule ^forum([0-9]+)(/?)+$ index.php?go=groups_forum&public_id=$1 [L]
# Сообщества -> Публичные страницы
RewriteCond %{QUERY_STRING} ^act=([a-z]+)
RewriteRule ^public([0-9]+)(/?)+$ index.php?go=public&pid=$1 [L]
#RewriteRule ^([^.]+)/?$ index.php?go=public&get_adres=$1 [L]
RewriteRule ^public([0-9]+)(/?)+$ index.php?go=public&pid=$1 [L]
RewriteRule ^yps /index.php?go=app [L]
RewriteRule ^kino(/?)+$ /index.php?go=app&act=kino [L]
RewriteRule ^photoshop(/?)+$ /index.php?go=app&act=photoshop [L]
RewriteRule ^settings/function(/?)+$ index.php?go=settings&act=function [L]
# Short Links for profiles and publics
RewriteRule ^([^.]+)/?$ index.php?go=short_link&link=$1 [L]
# Стат страницы
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+).html$ index.php?go=static&page=$1 [L]
# Чат
RewriteRule ^chat/(/?)+$ /index.php?go=im_chat [L]
# Страницы ошибок
ErrorDocument 404 /404.php