Header set Access-Control-Allow-Origin "*"

ErrorDocument 404 /pages/err_pages/404.php
ErrorDocument 403 /pages/err_pages/403.php

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^admin/?$ pages/admin/panel.php [QSA,L]

RewriteRule ^admin/arbitrage-disp?$ pages/admin/arbitrage/arbitr-disp.php [QSA,L]
RewriteRule ^admin/arbitrage-tickets?$ pages/admin/arbitrage/arbitr-tickets.php [QSA,L]

RewriteRule ^admin/payment-requests?$ pages/admin/payouts/payment-requests.php [QSA,L]
RewriteRule ^admin/search-info?$ pages/admin/seo/search-info.php [QSA,L]
RewriteRule ^admin/project-profit?$ pages/admin/profit/project-profit.php [QSA,L]
RewriteRule ^admin/platform-parameters?$ pages/admin/platform/platform-parameters.php [QSA,L]

RewriteRule ^admin/tickets?$ pages/admin/help/tickets.php [QSA,L]

RewriteRule ^admin/operator-details?$ pages/admin/operator/operator-details.php [QSA,L]

RewriteRule ^admin/nodes/?$ pages/admin/nodes/nodes.php [QSA,L]
RewriteRule ^admin/nodes/new-category/?$ pages/admin/nodes/new-category.php [QSA,L]
RewriteRule ^admin/nodes/new-subcategory([0-9]*)/?$ pages/admin/nodes/new-subcategory.php?id=$1 [QSA,L]
RewriteRule ^admin/nodes/new-section([0-9]*)/?$ pages/admin/nodes/new-section.php?id=$1 [QSA,L]
RewriteRule ^admin/nodes/edit-category([0-9]*)/?$ pages/admin/nodes/edit-category.php?id=$1 [QSA,L]
RewriteRule ^admin/nodes/edit-subcategory([0-9]*)/?$ pages/admin/nodes/edit-subcategory.php?id=$1 [QSA,L]
RewriteRule ^admin/nodes/edit-section([0-9]*)/?$ pages/admin/nodes/edit-section.php?id=$1 [QSA,L]
RewriteRule ^admin/nodes/del-section/?$ pages/admin/nodes/del-section.php [QSA,L]
RewriteRule ^admin/nodes/del-subcategory/?$ pages/admin/nodes/del-subcategory.php [QSA,L]
RewriteRule ^admin/nodes/del-category/?$ pages/admin/nodes/del-category.php [QSA,L]

RewriteRule ^admin/solutions/?$ pages/admin/solutions/solutions.php [QSA,L]
RewriteRule ^admin/solutions/del-solution/?$ pages/admin/solutions/del-solution.php [QSA,L]
RewriteRule ^admin/solutions/new-solution([0-9]*)/?$ pages/admin/solutions/new-solution.php?id=$1 [QSA,L]
RewriteRule ^admin/solutions/edit-solution([0-9]*)/?$ pages/admin/solutions/edit-solution.php?id=$1 [QSA,L]
RewriteRule ^admin/solutions/new-category/?$ pages/admin/solutions/new-category.php [QSA,L]
RewriteRule ^admin/solutions/new-section([0-9]*)/?$ pages/admin/solutions/new-section.php?id=$1 [QSA,L]
RewriteRule ^admin/solutions/edit-category([0-9]*)/?$ pages/admin/solutions/edit-category.php?id=$1 [QSA,L]
RewriteRule ^admin/solutions/edit-section([0-9]*)/?$ pages/admin/solutions/edit-section.php?id=$1 [QSA,L]
RewriteRule ^admin/solutions/del-section/?$ pages/admin/solutions/del-section.php [QSA,L]
RewriteRule ^admin/solutions/del-category/?$ pages/admin/solutions/del-category.php [QSA,L]

RewriteRule ^admin/users/?$ pages/admin/users/users.php [QSA,L]
RewriteRule ^admin/users/search-users?$ pages/admin/users/search-users.php [QSA,L]
RewriteRule ^admin/users/edit-user([0-9]*)/?$ pages/admin/users/edit-user.php?id=$1 [QSA,L]

RewriteRule ^admin/groups/?$ pages/admin/groups/groups.php [QSA,L]
RewriteRule ^admin/groups/new-group?$ pages/admin/groups/new-group.php [QSA,L]
RewriteRule ^admin/groups/edit-group([0-9]*)/?$ pages/admin/groups/edit-group.php?id=$1 [QSA,L]
RewriteRule ^admin/groups/del-group/?$ pages/admin/groups/del-group.php [QSA,L]

RewriteRule ^admin/plugins/disable/?$ pages/admin/module/off-module.php [QSA,L]
RewriteRule ^admin/plugins/enable/?$ pages/admin/module/on-module.php [QSA,L]
RewriteRule ^admin/plugins/delete/?$ pages/admin/module/del-module.php [QSA,L]
RewriteRule ^admin/plugins/upload?$ pages/admin/module/upload-module.php [QSA,L]
RewriteRule ^admin/plugins/?$ pages/admin/module/modules.php?type=other [QSA,L]

RewriteRule ^admin/plugins/payments?$ pages/admin/module/modules.php?type=payments [QSA,L]
RewriteRule ^admin/plugins/payments/([^/]+)/?(.*)$ core/plugins/payments/$1/$2 [L,QSA]
RewriteRule ^payment/([^/]+)/?(.*)$ core/plugins/payments/$1/$2 [L,QSA]

RewriteRule ^admin/plugins/oauth?$ pages/admin/module/modules.php?type=oauth [QSA,L]
RewriteRule ^admin/plugins/oauth/([^/]+)/?(.*)$ core/plugins/oauth/$1/$2 [L,QSA]
RewriteRule ^oauth/([^/]+)/?(.*)$ core/plugins/oauth/$1/$2 [L,QSA]

RewriteRule ^admin/plugins/captcha?$ pages/admin/module/modules.php?type=captcha [QSA,L]
RewriteRule ^admin/plugins/captcha/([^/]+)/?(.*)$ core/plugins/captcha/$1/$2 [L,QSA]

RewriteRule ^admin/plugins/([^/]+)/?(.*)$ core/plugins/other/$1/$2 [L,QSA]

RewriteRule ^admin/themes?$ pages/admin/theme/themes.php [QSA,L]
RewriteRule ^admin/themes/disable/?$ pages/admin/theme/off-theme.php [QSA,L]
RewriteRule ^admin/themes/enable/?$ pages/admin/theme/on-theme.php [QSA,L]
RewriteRule ^admin/themes/delete/?$ pages/admin/theme/del-theme.php [QSA,L]
RewriteRule ^admin/themes/upload?$ pages/admin/theme/upload-theme.php [QSA,L]
RewriteRule ^admin/themes/export-theme/([^/]+)/?$ pages/admin/theme/export-theme.php?id=$1 [QSA,L]

RewriteRule ^admin/license-agreement/?$ pages/admin/license/license.php [QSA,L]

RewriteRule ^admin/update/?$ pages/admin/update/update.php [QSA,L]
RewriteRule ^admin/update/upload?$ pages/admin/update/upload-update.php [QSA,L]
RewriteRule ^admin/update/delete?$ pages/admin/update/del-update.php [QSA,L]
RewriteRule ^admin/update/export-update/([^/]+)/?$ pages/admin/update/export-update.php?id=$1 [QSA,L]

RewriteRule ^payout/?$ pages/pay/payout.php [QSA,L]
RewriteRule ^pay/?$ pages/pay/pay.php [QSA,L]
RewriteRule ^pay/ok/?$ pages/pay/ok.php [QSA,L]
RewriteRule ^pay/fail/?$ pages/pay/fail.php [QSA,L]
RewriteRule ^callback-pay/?$ pages/pay/callback.php [QSA,L]

RewriteRule ^login/?$ pages/auth/login.php [QSA,L]
RewriteRule ^register/?$ pages/auth/register.php [QSA,L]
RewriteRule ^recover-pass/?$ pages/auth/recovery/forgot_password.php [L]
RewriteRule ^check-recover-code/?$ pages/auth/recovery/check_recovery_code.php [QSA,L]
RewriteRule ^change-recover-pass/?$ pages/auth/recovery/recover_change_password.php [QSA,L]
RewriteRule ^recovery-success/?$ pages/auth/recovery/recovery_success.php [L]

RewriteRule ^exit/?$ pages/auth/exit.php [QSA,L]
RewriteRule ^users/?$ pages/users/users.php [QSA,L]
RewriteRule ^new-works/?$ pages/works/new-works.php [QSA,L]
RewriteRule ^cart/?$ pages/favorites/favorites.php [QSA,L]

RewriteRule ^sales/?$ pages/user/sales.php [QSA,L]
RewriteRule ^buys/?$ pages/user/buys.php [QSA,L]
RewriteRule ^up-all-works/?$ pages/user/up-works.php [QSA,L]

RewriteRule ^mes/?$ pages/messages/mes.php [QSA,L]
RewriteRule ^mes/([0-9]*)/?$ pages/messages/dialog.php?id=$1 [QSA,L]

RewriteRule ^search/?$ pages/search/search.php [QSA,L]
RewriteRule ^tickets/?$ pages/tickets/tickets.php [QSA,L]

RewriteRule ^offer/?$ pages/help/offer.php [QSA,L]
RewriteRule ^privacy/?$ pages/help/privacy.php [QSA,L]
RewriteRule ^project-info/?$ pages/help/about.php [QSA,L]
RewriteRule ^rules/?$ pages/help/rules.php [QSA,L]
RewriteRule ^orders/?$ pages/help/services.php [QSA,L]

RewriteRule ^solutions/?$ pages/help/solutions/solutions.php [QSA,L]
RewriteRule ^solutions/question([0-9]*)/?$ pages/help/solutions/question.php?id=$1 [QSA,L]

RewriteRule ^account/?$ pages/profile/profile-edit.php [QSA,L]
RewriteRule ^account/design-profile/?$ pages/profile/design-profile.php [QSA,L]
RewriteRule ^account/sequrity/?$ pages/profile/profile-sequrity.php [QSA,L]
RewriteRule ^account/requisites/?$ pages/profile/profile-requisites.php [QSA,L]

RewriteRule ^set-file/?$ core/load-set-users.php [QSA,L]

RewriteRule ^balance/?$ pages/balance/balance.php [QSA,L]
RewriteRule ^balance/payment-requests?$ pages/balance/payouts.php [QSA,L]

RewriteRule ^feedback([0-9]*)/?$ pages/feedback/new-feedback.php?id=$1 [QSA,L]
RewriteRule ^feedback/edit([0-9]*)/?$ pages/feedback/edit-feedback.php?id=$1 [QSA,L]
RewriteRule ^feedback/delete/?$ pages/feedback/del-feedback.php [QSA,L]

RewriteRule ^deal([0-9]*)/?$ pages/deal/buy-page.php?id=$1 [QSA,L]
RewriteRule ^id([0-9]*)/?$ pages/profile/profile.php?id=$1 [QSA,L]

RewriteRule ^category([0-9]*)/?$ pages/catalog/category.php?id=$1 [QSA,L]
RewriteRule ^section([0-9]*)/?$ pages/catalog/sections.php?id=$1 [QSA,L]
RewriteRule ^subcategory([0-9]*)/?$ pages/catalog/subcategory.php?id=$1 [QSA,L]

RewriteRule ^work([0-9]*)/?$ pages/work/work.php?id=$1 [QSA,L]
RewriteRule ^new-work/?$ pages/work/new-work.php [QSA,L]
RewriteRule ^work-edit([0-9]*)/?$ pages/work/work-edit.php?id=$1 [QSA,L]

RewriteRule ^deal-view/([0-9]+)/([0-9]+)/?$ pages/deals/view-deals.php?creator=$1&worker=$2 [L,QSA]
RewriteRule ^down-mess/([0-9]+)/([0-9]+)/?$ pages/messages/download-messages.php?userA=$1&userB=$2 [L,QSA]

RewriteRule ^down/?(.*)$ core/download-mes.php?file=$1 [QSA,L]

RewriteRule ^ban/?$ pages/profile/ban.php [QSA,L]