Witam,
mam problem z replace_for_mod_rewrite a dokładnie z przepisywaniem adresów na proste
poniżej plik header.php
if (eregi("header.php",$_SERVER['PHP_SELF'])) { Header("Location: index.php"); }
function replace_for_mod_rewrite(&$s)
{
$urlin =
"'(?<!/)index.php'",
"'(?<!/)modules.php'",
"'(?<!/)show.html\?name=Ads&op=add_ad_check'",
"'(?<!/)show.html\?name=Ads&op=add_ad_photo'",
"'(?<!/)show.html\?name=Ads&op=add_ad'",
"'(?<!/)show.html\?name=Ads&op=search_advanced'",
"'(?<!/)show.html\?name=Ads&op=show_item&id=([1-9][0-9]*)&title=([a-zA-Z0-9+]*)'",
"'(?<!/)show.html\?name=Ads&op=edit_ad&ad_id=([1-9][0-9]*)'",
"'(?<!/)show.html\?name=Ads&op=del_ad&func=check&id=([1-9][0-9]*)'",
"'(?<!/)show.html\?name=Ads&op=edit_photo&ad_id=([1-9][0-9]*)'",
"'(?<!/)show.html\?name=Ads&op=del_photo&ad_id=([1-9][0-9]*)&folder=([a-zA-Z0-9+]*)&photo=([a-zA-Z0-9+]*)__([1-9][0-9]*).jpg'",
"'(?<!/)show.html\?name=Ads&op=del_photo&ad_id=([1-9][0-9]*)&folder=([a-zA-Z0-9+]*)&photo=([a-zA-Z0-9+]*).jpg'",
"'(?<!/)show.html\?name=Firm_Folder&rop=write_firm'",
"'(?<!/)show.html\?name=Firm_Folder&rop=showcontent&id=([1-9][0-9+]*)&title=([/:|\s\-\'{}().&_a-zA-Z0-9+=]*)'",
"'(?<!/)show.html\?name=Firm_Folder&rop=showcontent&id=([1-9][0-9+]*)'",
"'(?<!/)show.html\?name=Firm_Folder&rop=mod_firm&id=([1-9][0-9+]*)'",
"'(?<!/)show.html\?name=Firm_Folder&rop=del_firm&id_del=([1-9][0-9+]*)&title=([/:|\s\-\'{}().&_a-zA-Z0-9+=]*)'",
"'(?<!/)show.html\?name=Firm_Folder&rop=postcomment&id=([1-9][0-9+]*)&title=([/:|\s\-\'{}().&_a-zA-Z0-9+=]*)'",
"'(?<!/)show.html\?name=Firm_Folder&rop=del_comment&cid=([1-9][0-9+]*)&id=([1-9][0-9+]*)'",
"'(?<!/)show.html\?name=Firm_Folder&rop=([a-zA-Z0-9+]*)&field=([a-zA-Z0-9+]*)&order=([a-zA-Z0-9+]*)'",
"'(?<!/)show.html\?name=Firm_Folder&rop=([a-zA-Z0-9+]*)'",
"'(?<!/)show.html\?name=Firm_Folder'",
"'(?<!/)show.html\?name=Your_Account&op=userinfo&username=([a-zA-Z0-9+]*)'",
"'(?<!/)show.html\?name=Your_Account&op=userinfo&username=([a-zA-Z0-9+]*)'",
"'(?<!/)show.html\?name=Your_Account&op=userinfo&username=([a-zA-Z0-9+]*)'",
"'(?<!/)show.html\?name=Your_Account&op=userinfo&bypass=([0-9]*)&username=([a-zA-Z0-9+]*)'",
"'(?<!/)show.html\?name=Your_Account&op=userinfo&bypass=([0-9]*)&username=([a-zA-Z0-9+]*)'",
"'(?<!/)show.html\?name=Your_Account&op=userinfo&bypass=([0-9]*)&username=([a-zA-Z0-9+]*)'",
"'(?<!/)show.html\?name=Your_Account&op=userinfo&bypass=([0-9]*)&username=([a-zA-Z0-9+]*)'",
"'(?<!/)show.html\?name=Your_Account&op=pass_lost'",
"'(?<!/)show.html\?name=Your_Account&op=pass_lost'",
"'(?<!/)show.html\?name=Your_Account&file=index'",
"'(?<!/)show.html\?name=Your_Account&op=logout'",
"'(?<!/)show.html\?name=Your_Account&op=new_user'",
"'(?<!/)show.html\?name=Your_Account'",
"'(?<!/)show.html\?name=Help'",
"'(?<!/)pomoc.html&myfaq=yes&id_cat=([1-9][0-9]*)'",
"'(?<!/)pomoc.html&myfaq=yes&id_cat=([1-9][0-9]*)'",
"'(?<!/)show.html\?name=FeedBack'",
"'(?<!/)show.html\?name=Feedback'",
"'(?<!/)show.html\?name=Your_Account&file=index'",
"'(?<!/)show.html\?name=Your_Account&op=logout'",
"'(?<!/)show.html\?name=Extant&extant=1'",
"'(?<!/)show.html\?name=Advertising&op=view_banner&cid=([1-9][0-9]*)&bid=([1-9][0-9]*)'",
"'(?<!/)show.html\?name=Advertising&op=client_home'",
"'(?<!/)show.html\?name=Advertising&op=client_report&cid=([1-9][0-9]*)&bid=([1-9][0-9]*)'",
"'(?<!/)show.html\?name=Advertising&op=client'",
"'(?<!/)show.html\?name=Advertising&op=plans'",
"'(?<!/)show.html\?name=Advertising&op=terms'",
"'(?<!/)show.html\?name=Advertising&op=sitestats'",
"'(?<!/)show.html\?name=Advertising'",
"'(?<!/)show.html\?name=Content&pa=list_pages_categories&cid=1'",
"'(?<!/)show.html\?name=Content&pa=list_pages_categories&cid=4'",
"'(?<!/)show.html\?name=Content&pa=list_pages_categories&cid=2'",
"'(?<!/)show.html\?name=Content'",
);
"index.html",
"show.html",
"article\\1.html",
"sprawdzanie_ogloszenia.html",
"dodawanie_zdjec.html",
"dodaj_ogloszenie.html",
"szukaj_ogloszenia.html",
"ogloszenie_nr_\\1_\\2",
"edytuj_ogloszenie_nr_\\1.html",
"usun_ogloszenie_nr_\\1.html",
"edytuj_zdjecia_nr_\\1.html",
"usun_zdjecie_\\1_\\2_\\3_\\4.html",
"usun_zdjecie_\\1_\\2_\\3.html",
"dodaj_firme.html",
"firma_\\1_\\2.html",
"firma_\\1.html",
"edytuj_firme_id_\\1.html",
"usun_firme_\\2_id_\\1.html",
"komentarz_firmy_\\2_id_\\1.html",
"usun_komentarz_firmy_\\1_\\2.html",
"firmy_\\1_sort_\\2_\\3.html",
"firmy_\\1.html",
"katalog_firm.html",
"moje_konto-\\1.html",
"moje_konto-\\1.html",
"moje_konto-\\1.html",
"moje_konto-\\1.html",
"moje_konto-\\1.html",
"moje_konto-\\1.html",
"moje_konto-\\1.html",
"zapomnialem_hasla.html",
"zapomnialem_hasla.html",
"moje_konto.html",
"wyloguj.html",
"rejestracja.html",
"moje_konto.html",
"pomoc.html",
"pomoc_\\1.html",
"pomoc_\\1.html",
"kontakt.html",
"kontakt.html",
"moje_konto.html",
"wyloguj.html",
"wspolpraca_z_serwisem.html",
"reklama_banner_\\1_\\2.html",
"reklama_konto.html",
"reklama_raport_\\1_\\2.html",
"reklama_logowanie.html",
"reklama_plany_i_taryfy.html",
"reklama_regulamin.html",
"reklama_statystyki.html",
"reklama.html",
"kredyty_samochodowe.html",
"ubezpieczenia.html",
"leasing.html",
"finanse.html",
);
return $s;
}
a także wycinek z footer.php
echo replace_for_mod_rewrite
($contents); //display modified buffer to screen
i htaccess
DirectoryIndex index.php index.cgi index.pl index.shtml index.html
<Limit GET PUT POST>
order allow,deny
allow from all
</Limit>
# deny most common except .php
<FilesMatch "\.(inc|tpl|h|ihtml|sql|ini|conf|class|bin|spd|theme|module|exe)$">
deny from all
</FilesMatch>
#Disable .htaccess viewing from browser
<Files ~ "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</Files>
<Files ~ "\config.php$">
deny from all
</Files>
#ErrorDocument 404 <a href="http://maxi-auto.pl" target="_blank">http://maxi-auto.pl</a>
RewriteEngine On
#Articles
RewriteRule ^article([1-9][0-9]*).* show.html?name=News&file=article&sid=$1
RewriteRule ^article([1-9][0-9]*).* show.html?name=Ads&op=show_item&id=$1
#Ads
RewriteRule ^regulamin.html show.html?name=Help&myfaq=yes&id_cat=3#7
RewriteRule ^sprawdzanie_ogloszenia.html show.html?name=Ads&op=add_ad_check
RewriteRule ^dodawanie_zdjec.html show.html?name=Ads&op=add_ad_photo
RewriteRule ^dodaj_ogloszenie.html show.html?name=Ads&op=add_ad
RewriteRule ^szukaj_ogloszenia.html show.html?name=Ads&op=search_advanced
RewriteRule ^ogloszenie_nr_([1-9][0-9]*)_([a-zA-Z0-9+]*).html show.html?name=Ads&op=show_item&id=$1&title=$2
RewriteRule ^edytuj_ogloszenie_nr_([1-9][0-9]*).html show.html?name=Ads&op=edit_ad&ad_id=$1
RewriteRule ^usun_ogloszenie_nr_([1-9][0-9]*).html show.html?name=Ads&op=del_ad&func=check&id=$1
RewriteRule ^edytuj_zdjecia_nr_([1-9][0-9]*).html show.html?name=Ads&op=edit_photo&ad_id=$1
RewriteRule ^usun_zdjecie_([1-9][0-9]*)_([a-zA-Z0-9+]*)_([a-zA-Z0-9+]*).html show.html?name=Ads&op=del_photo&ad_id=$1&folder=$2&photo=$3.jpg
RewriteRule ^usun_zdjecie_([1-9][0-9]*)_([a-zA-Z0-9+]*)_([a-zA-Z0-9+]*)_([1-9]*).html show.html?name=Ads&op=del_photo&ad_id=$1&folder=$2&photo=$3__$4.jpg
RewriteRule ^sprzedaj.html show.html?name=Your_Account&redirect=modules.php?name=Ads&op=add_ad
RewriteRule ^sprzedaj.html show.html?name=modules.php?name=Ads&op=add_ad
RewriteRule ^wyloguj.html show.html?name=Your_Account&op=logout
#FIRM FOLDER
RewriteRule ^katalog_firm.html show.html?name=Firm_Folder
RewriteRule ^dodaj_firme.html show.html?name=Firm_Folder&rop=write_firm
RewriteRule ^firma_([1-9][0-9+]*).html show.html?name=Firm_Folder&rop=showcontent&id=$1
RewriteRule ^firma_([1-9][0-9+]*)_([/:|\s\-\'{}().&_a-zA-Z0-9+=]*).html show.html?name=Firm_Folder&rop=showcontent&id=$1&title=$2
RewriteRule ^edytuj_firme_id_([1-9][0-9+]*).html show.html?name=Firm_Folder&rop=mod_firm&id=$1
RewriteRule ^usun_firme_([/:|\s\-\'{}().&_a-zA-Z0-9+=]*)_id_([1-9][0-9+]*).html show.html?name=Firm_Folder&rop=del_firm&id_del=$2&title=$1
RewriteRule ^firma_([1-9][0-9+]*)_p([1-9][0-9+]*).html show.html?name=Firm_Folder&rop=showcontent&id=$1&page=$2
RewriteRule ^firmy_([a-zA-Z0-9+]*)_sort_([a-zA-Z0-9+]*)_([a-zA-Z0-9+]*).html show.html?name=Firm_Folder&rop=$1&field=$2&order=$3
RewriteRule ^firmy_([a-zA-Z0-9+]*).html show.html?name=Firm_Folder&rop=$1
RewriteRule ^komentarz_firmy_([/:|\s\-\'{}().&_a-zA-Z0-9+=]*)_id_([1-9][0-9+]*).html show.html?name=Firm_Folder&rop=postcomment&id=$2&title=$1
RewriteRule ^usun_komentarz_firmy_([1-9][0-9+]*)_([1-9][0-9+]*).html show.html?name=Firm_Folder&rop=del_comment&cid=$1&id=$2
#HELP
RewriteRule ^pomoc.html show.html?name=Help
RewriteRule ^pomoc_([1-9][0-9]*).html show.html?name=Help&myfaq=yes&id_cat=$1
#Kontakt
RewriteRule ^kontakt.html show.html?name=Feedback
#Your Account
RewriteRule ^moje_konto.html show.html?name=Your_Account&file=index
RewriteRule ^moje_konto.html show.html?name=Your_Account
RewriteRule ^zapomnialem_hasla.html show.html?name=Your_Account&op=pass_lost
RewriteRule ^wyloguj.html show.html?name=Your_Account&op=logout
RewriteRule ^zapomnialem_hasla.html show.html?name=Your_Account&op=pass_lost
RewriteRule ^moje_konto_([a-zA-Z0-9+]*).html show.html?name=Your_Account&op=userinfo&username=$1
RewriteRule ^moje_konto_([a-zA-Z0-9+]*)_([1-9][0-9]*).html show.html?name=Your_Account&op=userinfo&bypass=$2&username=$1
RewriteRule ^rejestracja.html show.html?name=Your_Account&op=new_user
#Wspolpraca
RewriteRule ^wspolpraca_z_serwisem.html show.html?name=Extant&extant=1
#Reklama
RewriteRule ^reklama_banner_([1-9][0-9+]*)_([1-9][0-9+]*).html show.html?name=Advertising&op=view_banner&cid=$1&bid=$2
RewriteRule ^reklama_konto.html show.html?name=Advertising&op=client_home
RewriteRule ^reklama_raport_([1-9][0-9+]*)_([1-9][0-9+]*).html show.html?name=Advertising&op=client_report&cid=$1&bid=$2
RewriteRule ^reklama.html show.html?name=Advertising
RewriteRule ^reklama_plany_i_taryfy.html show.html?name=Advertising&op=plans
RewriteRule ^reklama_regulamin.html show.html?name=Advertising&op=terms
RewriteRule ^reklama_statystyki.html show.html?name=Advertising&op=sitestats
RewriteRule ^reklama_logowanie.html show.html?name=Advertising&op=client
#Finanse
RewriteRule ^kredyty_samochodowe.html show.html?name=Content&pa=list_pages_categories&cid=1
RewriteRule ^ubezpieczenia.html show.html?name=Content&pa=list_pages_categories&cid=4
RewriteRule ^leasing.html show.html?name=Content&pa=list_pages_categories&cid=2
RewriteRule ^finanse.html show.html?name=Content
RewriteRule ^index.html index.php
RewriteRule ^show.html modules.php
i problem jest w tym że przepisuje adresy jednak nie zmienia ich właściwie tzn myli kolejności,
zamiast dodaj ogłoszenie jest dodaj zdjęcie
ok zamykam, doszedłem co było nie tak, dziękuję za zainteresowanie