RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R]

#ogólne
RewriteRule ^rejestracja$ index.php?module=globelusUser&action=register [L]
RewriteRule ^logowanie$ index.php?module=globelusUser&action=login [L]
RewriteRule ^odzyskiwanie-hasla$ index.php?module=globelusUser&action=recover_password [L]
RewriteRule ^ponowna-aktywacja/([a-zA-Z0-9-]*)(|/)$ index.php?module=globelusUser&action=resend_activation_mail&hash=$1 [L]
RewriteRule ^login-as/([a-zA-Z0-9-]*)(|/)$ index.php?module=globelusUser&action=login_as&hash=$1&%{QUERY_STRING} [L]

#baza ogłoszeń
RewriteRule ^aplikuj/([0-9]*)(|/)$ index.php?module=globelusAdverts&action=advert_apply&advert_id=$1 [L]
RewriteCond %{QUERY_STRING} =""
RewriteRule ^oferty-pracy$ index.php?module=globelusAdverts&action=adverts_list&cp=1&filtr_reset=true&%{QUERY_STRING} [L]
RewriteCond %{QUERY_STRING} !=""
RewriteRule ^oferty-pracy$ index.php?module=globelusAdverts&action=adverts_list&cp=1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([0-9]*)(|/)$ index.php?module=globelusAdverts&action=adverts_list&cp=$1&%{QUERY_STRING} [L]
RewriteRule ^oferta/([0-9]*)/([a-zA-Z0-9-]*)(|/)$ index.php?module=globelusAdverts&action=advert_details&advert_id=$1 [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)(|/)$ index.php?module=globelusAdverts&action=adverts_list&cp=1&filtr=t&cc_name=$1&cc_name2=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/z-podanym-wynagrodzeniem$ index.php?module=globelusAdverts&action=adverts_list&cp=1&filtr=t&sl=on&cc_name=$1&cc_name2=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/z-podanym-wynagrodzeniem/([0-9]*)(|/)$ index.php?module=globelusAdverts&action=adverts_list&cp=$2&filtr=t&sl=on&cc_name=$1&cc_name2=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/bez-jezyka$ index.php?module=globelusAdverts&action=adverts_list&cp=1&filtr=t&wl=on&cc_name=$1&cc_name2=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/bez-jezyka/([0-9]*)(|/)$ index.php?module=globelusAdverts&action=adverts_list&cp=$2&filtr=t&wl=on&cc_name=$1&cc_name2=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/bez-doswiadczenia$ index.php?module=globelusAdverts&action=adverts_list&cp=1&filtr=t&we=on&cc_name=$1&cc_name2=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/bez-doswiadczenia/([0-9]*)(|/)$ index.php?module=globelusAdverts&action=adverts_list&cp=$2&filtr=t&we=on&cc_name=$1&cc_name2=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/dla-par$ index.php?module=globelusAdverts&action=adverts_list&cp=1&filtr=t&fc=on&cc_name=$1&cc_name2=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/dla-par/([0-9]*)(|/)$ index.php?module=globelusAdverts&action=adverts_list&cp=$2&filtr=t&fc=on&cc_name=$1&cc_name2=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/od-zaraz$ index.php?module=globelusAdverts&action=adverts_list&cp=1&filtr=t&fn=on&cc_name=$1&cc_name2=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/od-zaraz/([0-9]*)(|/)$ index.php?module=globelusAdverts&action=adverts_list&cp=$2&filtr=t&fn=on&cc_name=$1&cc_name2=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/cala-polska$ index.php?module=globelusAdverts&action=adverts_list&cp=1&filtr=t&v[]=1&cc_name=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/cala-polska/([0-9]*)(|/)$ index.php?module=globelusAdverts&action=adverts_list&cp=$2&filtr=t&v[]=1&cc_name=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/dolnoslaskie$ index.php?module=globelusAdverts&action=adverts_list&cp=1&filtr=t&v[]=2&cc_name=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/dolnoslaskie/([0-9]*)(|/)$ index.php?module=globelusAdverts&action=adverts_list&cp=$2&filtr=t&v[]=2&cc_name=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/kujawsko-pomorskie$ index.php?module=globelusAdverts&action=adverts_list&cp=1&filtr=t&v[]=3&cc_name=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/kujawsko-pomorskie/([0-9]*)(|/)$ index.php?module=globelusAdverts&action=adverts_list&cp=$2&filtr=t&v[]=3&cc_name=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/lubelskie$ index.php?module=globelusAdverts&action=adverts_list&cp=1&filtr=t&v[]=4&cc_name=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/lubelskie/([0-9]*)(|/)$ index.php?module=globelusAdverts&action=adverts_list&cp=$2&filtr=t&v[]=4&cc_name=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/lubuskie$ index.php?module=globelusAdverts&action=adverts_list&cp=1&filtr=t&v[]=5&cc_name=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/lubuskie/([0-9]*)(|/)$ index.php?module=globelusAdverts&action=adverts_list&cp=$2&filtr=t&v[]=5&cc_name=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/lodzkie$ index.php?module=globelusAdverts&action=adverts_list&cp=1&filtr=t&v[]=6&cc_name=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/lodzkie/([0-9]*)(|/)$ index.php?module=globelusAdverts&action=adverts_list&cp=$2&filtr=t&v[]=6&cc_name=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/malopolskie$ index.php?module=globelusAdverts&action=adverts_list&cp=1&filtr=t&v[]=7&cc_name=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/malopolskie/([0-9]*)(|/)$ index.php?module=globelusAdverts&action=adverts_list&cp=$2&filtr=t&v[]=7&cc_name=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/mazowieckie$ index.php?module=globelusAdverts&action=adverts_list&cp=1&filtr=t&v[]=8&cc_name=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/mazowieckie/([0-9]*)(|/)$ index.php?module=globelusAdverts&action=adverts_list&cp=$2&filtr=t&v[]=8&cc_name=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/opolskie$ index.php?module=globelusAdverts&action=adverts_list&cp=1&filtr=t&v[]=9&cc_name=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/opolskie/([0-9]*)(|/)$ index.php?module=globelusAdverts&action=adverts_list&cp=$2&filtr=t&v[]=9&cc_name=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/podkarpackie$ index.php?module=globelusAdverts&action=adverts_list&cp=1&filtr=t&v[]=10&cc_name=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/podkarpackie/([0-9]*)(|/)$ index.php?module=globelusAdverts&action=adverts_list&cp=$2&filtr=t&v[]=10&cc_name=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/podlaskie$ index.php?module=globelusAdverts&action=adverts_list&cp=1&filtr=t&v[]=11&cc_name=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/podlaskie/([0-9]*)(|/)$ index.php?module=globelusAdverts&action=adverts_list&cp=$2&filtr=t&v[]=11&cc_name=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/pomorskie$ index.php?module=globelusAdverts&action=adverts_list&cp=1&filtr=t&v[]=12&cc_name=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/pomorskie/([0-9]*)(|/)$ index.php?module=globelusAdverts&action=adverts_list&cp=$2&filtr=t&v[]=12&cc_name=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/slaskie$ index.php?module=globelusAdverts&action=adverts_list&cp=1&filtr=t&v[]=13&cc_name=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/slaskie/([0-9]*)(|/)$ index.php?module=globelusAdverts&action=adverts_list&cp=$2&filtr=t&v[]=13&cc_name=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/swietokrzyskie$ index.php?module=globelusAdverts&action=adverts_list&cp=1&filtr=t&v[]=14&cc_name=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/swietokrzyskie/([0-9]*)(|/)$ index.php?module=globelusAdverts&action=adverts_list&cp=$2&filtr=t&v[]=14&cc_name=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/warminsko-mazurskie$ index.php?module=globelusAdverts&action=adverts_list&cp=1&filtr=t&v[]=15&cc_name=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/warminsko-mazurskie/([0-9]*)(|/)$ index.php?module=globelusAdverts&action=adverts_list&cp=$2&filtr=t&v[]=15&cc_name=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/wielkopolskie$ index.php?module=globelusAdverts&action=adverts_list&cp=1&filtr=t&v[]=16&cc_name=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/wielkopolskie/([0-9]*)(|/)$ index.php?module=globelusAdverts&action=adverts_list&cp=$2&filtr=t&v[]=16&cc_name=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/zachodniopomorskie$ index.php?module=globelusAdverts&action=adverts_list&cp=1&filtr=t&v[]=17&cc_name=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/zachodniopomorskie/([0-9]*)(|/)$ index.php?module=globelusAdverts&action=adverts_list&cp=$2&filtr=t&v[]=17&cc_name=$1&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/([a-zA-Z-]*)(|/)$ index.php?module=globelusAdverts&action=adverts_list&cp=1&filtr=t&cc_name=$1&cc_name2=$2&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/([a-zA-Z-]*)/([0-9]*)(|/)$ index.php?module=globelusAdverts&action=adverts_list&cp=$3&filtr=t&cc_name=$1&cc_name2=$2&%{QUERY_STRING} [L]
RewriteRule ^oferty-pracy/([a-zA-Z-]*)/([0-9]*)(|/)$ index.php?module=globelusAdverts&action=adverts_list&cp=$2&filtr=t&cc_name=$1&cc_name2=$1%{QUERY_STRING} [L]

#lista pracodawców
RewriteRule ^pracodawcy(|/)$ index.php?module=globelusFirms&action=firms_list&cp=1 [L]
RewriteRule ^pracodawcy/([a-z]*)(|/)$ index.php?module=globelusFirms&action=firms_list&cp=1&letter=$1 [L]
RewriteRule ^pracodawcy/([a-z]*)/([0-9]*)(|/)$ index.php?module=globelusFirms&action=firms_list&cp=$2&letter=$1 [L]
RewriteRule ^pracodawcy/([0-9]*)(|/)$ index.php?module=globelusFirms&action=firms_list&cp=$1 [L]
RewriteRule ^pracodawca/([0-9]*)/([a-zA-Z0-9-]*)(|/)$ index.php?module=globelusFirms&action=firm_profile&user_id=$1 [L]

#pobieranie cv
RewriteRule ^cv/([0-9]*)/([a-zA-Z0-9-]*)(|/)$ index.php?module=globelusCandidates&action=cv_download&user_id=$1&token=$2 [L]
RewriteRule ^cv-tmp/([0-9]*)/([a-zA-Z0-9-]*)(|/)$ index.php?module=globelusCandidates&action=cv_tmp_download&answer_id=$1&token=$2 [L]

#avatary
RewriteRule ^avatar/([0-9]*)/([a-zA-Z0-9-]*)(|/)$ index.php?module=globelusCandidates&action=avatar&user_id=$1&token=$2 [L]

#loga
RewriteRule ^logo/([0-9]*)/([a-zA-Z0-9-]*)(|/)$ index.php?module=globelusFirms&action=logo&user_id=$1&token=$2 [L]
RewriteRule ^img_header/([0-9]*)/([a-zA-Z0-9-]*)(|/)$ index.php?module=globelusFirms&action=img_header&user_id=$1&token=$2 [L]
RewriteRule ^img_bottom/([0-9]*)/([a-zA-Z0-9-]*)(|/)$ index.php?module=globelusFirms&action=img_bottom&user_id=$1&token=$2 [L]
RewriteRule ^advert_add_img_top/([0-9]*)/([a-zA-Z0-9-]*)(|/)$ index.php?module=globelusFirms&action=advert_add_img_top&advert_id=$1&token=$2 [L]
RewriteRule ^advert_add_img_bottom/([0-9]*)/([a-zA-Z0-9-]*)(|/)$ index.php?module=globelusFirms&action=advert_add_img_bottom&advert_id=$1&token=$2 [L]

#baza cv
RewriteRule ^baza-cv(|/)$ index.php?module=globelusCv&action=cv_list&cp=1&%{QUERY_STRING} [L]
RewriteRule ^baza-cv/([0-9]*)(|/)$ index.php?module=globelusCv&action=cv_list&cp=$1&%{QUERY_STRING} [L]
RewriteRule ^kandydat/([0-9]*)/([a-zA-Z0-9-]*)(|/)$ index.php?module=globelusCv&action=candidate_profile&user_id=$1 [L]
RewriteRule ^proponowany-kandydat/([0-9]*)/([a-zA-Z0-9-]*)(|/)$ index.php?module=globelusCv&action=proposed_candidate_profile&user_id=$1 [L]

#panel kandydata
RewriteRule ^panel-kandydata/profil(|/)$ index.php?module=globelusCandidates&action=profile_preview [L]
RewriteRule ^panel-kandydata/odswiez(|/)$ index.php?module=globelusCandidates&action=profile_refresh [L]
RewriteRule ^panel-kandydata/przedluz(|/)$ index.php?module=globelusCandidates&action=profile_extend [L]
RewriteRule ^panel-kandydata/wylacz-profil(|/)$ index.php?module=globelusCandidates&action=profile_disable [L]
RewriteRule ^panel-kandydata/publikuj-profil(|/)$ index.php?module=globelusCandidates&action=profile_enable [L]
RewriteRule ^panel-kandydata/ustawienia-konta(|/)$ index.php?module=globelusCandidates&action=profile_settings [L]
RewriteRule ^panel-kandydata/edycja-profilu(|/)$ index.php?module=globelusCandidates&action=profile_edit [L]
RewriteRule ^panel-kandydata/wyslane-aplikacje(|/)$ index.php?module=globelusCandidates&action=answers_list [L]
RewriteRule ^panel-kandydata/obserwowane-oferty(|/)$ index.php?module=globelusCandidates&action=adverts_list [L]
RewriteRule ^panel-kandydata(|/)$ panel-kandydata/profil [L,R=301]

#panel pracodawcy
RewriteRule ^panel-pracodawcy/profil(|/)$ index.php?module=globelusFirms&action=profile_preview [L]
RewriteRule ^panel-pracodawcy/ustawienia-konta(|/)$ index.php?module=globelusFirms&action=profile_settings [L]
RewriteRule ^panel-pracodawcy/edycja-profilu(|/)$ index.php?module=globelusFirms&action=profile_edit [L]
RewriteRule ^panel-pracodawcy/ogloszenia(|/)$ index.php?module=globelusFirms&action=adverts_list [L]
RewriteRule ^panel-pracodawcy/ogloszenia/alert_promotion(|/)$ index.php?module=globelusFirms&action=adverts_list&alert_promotion=true [L]
RewriteRule ^panel-pracodawcy/dodaj-ogloszenie(|/)$ index.php?module=globelusFirms&action=advert_add [L]
RewriteRule ^panel-pracodawcy/edytuj-ogloszenie/([0-9]*)$ index.php?module=globelusFirms&action=advert_edit&advert_id=$1 [L]
RewriteRule ^panel-pracodawcy/odpowiedzi/([0-9]*)$ index.php?module=globelusFirms&action=advert_answers&advert_id=$1 [L]
RewriteRule ^panel-pracodawcy/odpowiedzi-na-ogloszenia(|/)$ index.php?module=globelusFirms&action=answers [L]
RewriteRule ^panel-pracodawcy/obserwowani-kandydaci(|/)$ index.php?module=globelusFirms&action=followed_candidates [L]
RewriteRule ^panel-pracodawcy/proponowani-kandydaci(|/)$ index.php?module=globelusFirms&action=proposed_candidates [L]
RewriteRule ^panel-pracodawcy/przedluz-ogloszenie/([0-9]*)(|/)$ index.php?module=globelusFirms&action=advert_extend&advert_id=$1 [L]
RewriteRule ^panel-pracodawcy(|/)$ panel-pracodawcy/profil [L,R=301]
RewriteRule ^panel-pracodawcy/odswiez-ogloszenie/([0-9]*)(|/)$ index.php?module=globelusFirms&action=advert_refresh&advert_id=$1 [L]
RewriteRule ^panel-pracodawcy/zakup-punktow(|/)$ index.php?module=globelusFirms&action=buy_points [L]
RewriteRule ^panel-pracodawcy/zakup-punktow/pakiet=([0-9]*)(|/)$ index.php?module=globelusFirms&action=create_order&package=$1 [L]
RewriteRule ^panel-pracodawcy/zakup-punktow/status(|/)$ index.php?module=globelusFirms&action=set_order_status [L]
RewriteRule ^panel-pracodawcy/zakup-punktow/platnosc-prawidlowa(|/)$ index.php?module=globelusFirms&action=payment_success [L]
RewriteRule ^panel-pracodawcy/zakup-punktow/platnosc-nieprawidlowa(|/)$ index.php?module=globelusFirms&action=payment_error [L]