Skocz do zawartości

Problem z mod+rewrite w IPB


AQQry

Rekomendowane odpowiedzi

Witma mam cos takiego

#
#  mod_rewrite in use
#

RewriteEngine On

#  Uncomment following line if your webserver's URL 
#  is not directly related to physival file paths.
#  This is usually not needed.

# RewriteBase /YourForumDirectory

#
#  Rules
#

# DO THE TOPIC URLS
RewriteRule ^(.*)-t([0-9]*)-s([0-9]*)\.html(.*)$ index.php?showtopic=$2&st=$3
RewriteRule ^(.*)-t([0-9]*)\.html(.*)$ index.php?showtopic=$2$3

# DO THE FORUM URLS
RewriteRule ^(.*)-new-topic-f([0-9]*)\.html(.*)$ index.php?act=Post&CODE=00&f=$2$3
RewriteRule ^(.*)-new-poll-f([0-9]*)\.html(.*)$ index.php?act=Post&CODE=10&f=$2$3
RewriteRule ^(.*)-f([0-9]*)\.html(.*)$ index.php?showforum=$2$3

# CALENDER
RewriteRule ^(.*)-e([0-9]*)\.html(.*)$ index.php?act=calendar&code=showevent&eventid=$2$3
RewriteRule ^add-new-event\.html(.*)$ index.php?act=calendar&code=newevent$1
RewriteRule ^events-this-month\.html(.*)$ index.php?act=calendar&code=find&what=thismonth$1
RewriteRule ^events-this-week\.html(.*)$ index.php?act=calendar&code=find&what=thisweek$1
RewriteRule ^go-to-month-([0-9]*)-([0-9]*)\.html(.*)$ index.php?act=calendar&m=$1&y=$2$3
RewriteRule ^show-week-([0-9]*)\.html(.*)$ index.php?act=calendar&code=showweek&week=$1$2
RewriteRule ^show-day-([0-9]*)-([0-9]*)-([0-9]*)\.html(.*)$ index.php?act=calendar&code=showday&y=$3&m=$2&d=$1$4

RewriteRule ^calendar\.html(.*)$ index.php?act=calendar$1

# DO EMAIL AND PM URLS
RewriteRule ^(.*)-a-private-message-m([0-9]*)\.html(.*)$ index.php?act=Msg&CODE=4&MID=$2$3
RewriteRule ^(.*)-an-email-m([0-9]*)\.html(.*)$ index.php?act=Mail&CODE=00&MID=$2$3

# DO THE PROFILE URLS
RewriteRule ^(.*)-m([0-9]*)\.html(.*)$ index.php?showuser=$2$3

# Login/Logout
RewriteRule ^logout\.html(.*)$ index.php?act=Login&CODE=03$1
RewriteRule ^login\.html(.*)$ index.php?act=Login&CODE=00$1
RewriteRule ^register\.html(.*)$ index.php?act=Reg&CODE=00$1

# STATS AND LEGENDS
RewriteRule ^the-moderating-team\.html(.*)$ index.php?act=Stats&CODE=leaders$1
RewriteRule ^todays-top-10-posters\.html(.*)$ index.php?act=Stats$1

# MEMBERS LIST
RewriteRule ^member-list\.html(.*)$ index.php?act=Members$1

# HELP
RewriteRule ^(.*)-h([0-9]*)\.html(.*)$ index.php?act=help&CODE=01&HID=$2$3
RewriteRule ^(.*)help\.html(.*)$ index.php?act=Help$3

# USER CP
RewriteRule ^my-controls\.html(.*)$ index.php?act=UserCP&CODE=00$1
# MESSENGER
RewriteRule ^compose-new-message\.html(.*)$ index.php?act=Msg&CODE=04$1
RewriteRule ^inbox\.html(.*)$ index.php?act=Msg&CODE=01&VID=in$1
RewriteRule ^sent-items\.html(.*)$ index.php?act=Msg&CODE=01&VID=sent$1
RewriteRule ^saved-pms\.html(.*)$ index.php?act=Msg&CODE=20$1
RewriteRule ^empty-pm-folders\.html(.*)$ index.php?act=Msg&CODE=delete$1
RewriteRule ^edit-storage-folders\.html(.*)$ index.php?act=Msg&CODE=07$1
RewriteRule ^pm-buddies\.html(.*)$ index.php?act=Msg&CODE=02$1
RewriteRule ^archive-messages\.html(.*)$ index.php?act=Msg&CODE=14$1
RewriteRule ^message-tracker\.html(.*)$ index.php?act=Msg&CODE=30$1
# SUBSCRIPTIONS
RewriteRule ^view-topic-subscriptions\.html(.*)$ index.php?act=UserCP&CODE=26$1
RewriteRule ^view-forum-subscriptions\.html(.*)$ index.php?act=UserCP&CODE=50$1
# PERSONAL PROFILE
RewriteRule ^edit-profile-info\.html(.*)$ index.php?act=UserCP&CODE=01$1

# GET NEW POSTS
RewriteRule ^get-new-posts\.html(.*)$ index.php?act=Search&CODE=getnew$1

# DO THE FORUM INDEX
RewriteRule ^forums\.html(.*)$ index.php?act=idx$3

forum mam w subdomenie... no i nie dziala... a ze slabo sie na tym znam za chiny nie wiem co nie tak tu jest :/

prosze o pomoc :crazy:

Pozdrawiam, (-;

www.topposition.pl - Top Position

tp468x60_banerrr.png

Odnośnik do komentarza
Udostępnij na innych stronach

a wic jest to mod do IPB zmieniajacy linki

drugi plik ktory nalezy wgrac na serwer to

<?php

//Friendly URL Mod for Invision Power Board 2.0

$FURL = new FURL;

$oldskin = "";

while ($ibforums->skin['_wrapper']!=$oldskin){
$oldskin = $ibforums->skin['_wrapper'];

// Do the topics
$ibforums->skin['_wrapper'] = preg_replace("#index.php\?showtopic=([0-9]*)\"#ie","\$FURL->create_topic_url('\\1')", $ibforums->skin['_wrapper'],1);
$ibforums->skin['_wrapper'] = preg_replace("#index.php\?showtopic=([0-9]*)&hl=\"#ie","\$FURL->create_topic_url('\\1')", $ibforums->skin['_wrapper'],1);
$ibforums->skin['_wrapper'] = preg_replace("#index.php\?showtopic=([0-9]*)&st=([0-9]*)\"#ie","\$FURL->create_topic_url('\\1','\\2')", $ibforums->skin['_wrapper'],1);

// Do the forums
$ibforums->skin['_wrapper'] = preg_replace("#index.php\?showforum=([0-9]*)#ie","\$FURL->create_forum_url('\\1')",$ibforums->skin['_wrapper'],1);

// Create Topic/Poll URL
$ibforums->skin['_wrapper'] = preg_replace("#index.php\?act=Post&CODE=00&f=([0-9]*)#ie","\$FURL->create_create_topic_url('\\1')",$ibforums->skin['_wrapper'],1);
$ibforums->skin['_wrapper'] = preg_replace("#index.php\?act=Post&CODE=10&f=([0-9]*)#ie","\$FURL->create_create_poll_url('\\1')",$ibforums->skin['_wrapper'],1);

// Calendar
$ibforums->skin['_wrapper'] = preg_replace("#index.php\?act=calendar&CODE=showevent&eventid=([0-9]*)#ie","\$FURL->create_event_url('\\1')",$ibforums->skin['_wrapper'],1);

// Help
$ibforums->skin['_wrapper'] = preg_replace("#index.php\?act=Help&CODE=01&HID=([0-9]*)#ie","\$FURL->create_help_url('\\1')",$ibforums->skin['_wrapper'],1);


// Profiles
$ibforums->skin['_wrapper'] = preg_replace("#index.php\?showuser=([0-9]*)#ie","\$FURL->create_member_url('\\1')",$ibforums->skin['_wrapper'],1);
//>PM and Email URL's
$ibforums->skin['_wrapper'] = preg_replace("#index.php\?act=Msg&CODE=4&MID=([0-9]*)#ie","\$FURL->create_member_pm_url('\\1')",$ibforums->skin['_wrapper'],1);
$ibforums->skin['_wrapper'] = preg_replace("#index.php\?act=Mail&CODE=00&MID=([0-9]*)#ie","\$FURL->create_member_email_url('\\1')",$ibforums->skin['_wrapper'],1);
}

// UserCP
  $ibforums->skin['_wrapper'] = preg_replace("'index.php\?act=UserCP&CODE=00'","my-controls.html",$ibforums->skin['_wrapper']);
//>Messenger
$ibforums->skin['_wrapper'] = preg_replace("'index.php\?act=Msg&CODE=04'","compose-new-message.html",$ibforums->skin['_wrapper']);
$ibforums->skin['_wrapper'] = preg_replace("'index.php\?act=Msg&CODE=01&VID=in'","inbox.html",$ibforums->skin['_wrapper']);
$ibforums->skin['_wrapper'] = preg_replace("'index.php\?act=Msg&CODE=01&VID=sent'","sent-items.html",$ibforums->skin['_wrapper']);
$ibforums->skin['_wrapper'] = preg_replace("'index.php\?act=Msg&CODE=20'","saved-pms.html",$ibforums->skin['_wrapper']);
$ibforums->skin['_wrapper'] = preg_replace("'index.php\?act=Msg&CODE=delete'","empty-pm-folders.html",$ibforums->skin['_wrapper']);
$ibforums->skin['_wrapper'] = preg_replace("'index.php\?act=Msg&CODE=07'","edit-storage-folders.html",$ibforums->skin['_wrapper']);
$ibforums->skin['_wrapper'] = preg_replace("'index.php\?act=Msg&CODE=02'","pm-buddies.html",$ibforums->skin['_wrapper']);
$ibforums->skin['_wrapper'] = preg_replace("'index.php\?act=Msg&CODE=14'","archive-messages.html",$ibforums->skin['_wrapper']);
$ibforums->skin['_wrapper'] = preg_replace("'index.php\?act=Msg&CODE=30'","message-tracker.html",$ibforums->skin['_wrapper']);
//>Subscriptions
$ibforums->skin['_wrapper'] = preg_replace("'index.php\?act=UserCP&CODE=26'","view-topic-subscriptions.html",$ibforums->skin['_wrapper']);
$ibforums->skin['_wrapper'] = preg_replace("'index.php\?act=UserCP&CODE=50'","view-forum-subscriptions.html",$ibforums->skin['_wrapper']);
//>Personal Profile
$ibforums->skin['_wrapper'] = preg_replace("'index.php\?act=UserCP&CODE=01'","edit-profile-info.html",$ibforums->skin['_wrapper']);


// Search URL's
$ibforums->skin['_wrapper'] = preg_replace("'index.php\?act=Search&CODE=getnew'","get-new-posts.html",$ibforums->skin['_wrapper']);

// Do the forum index
$ibforums->skin['_wrapper'] = preg_replace("'index.php\?act=idx'","forums.html",$ibforums->skin['_wrapper']);

// Help
$ibforums->skin['_wrapper'] = preg_replace("'index.php\?act=Help'","help.html",$ibforums->skin['_wrapper']);


// Login/Logout/Register
$ibforums->skin['_wrapper'] = preg_replace("'index.php\?act=Login&CODE=03'","logout.html",$ibforums->skin['_wrapper']);
$ibforums->skin['_wrapper'] = preg_replace("'index.php\?act=Login&CODE=00'","login.html",$ibforums->skin['_wrapper']);
$ibforums->skin['_wrapper'] = preg_replace("'index.php\?act=Reg&CODE=00'","register.html",$ibforums->skin['_wrapper']);

// Stats and legends
$ibforums->skin['_wrapper'] = preg_replace("'index.php\?act=Stats&CODE=leaders'","the-moderating-team.html",$ibforums->skin['_wrapper']);
$ibforums->skin['_wrapper'] = preg_replace("'index.php\?act=Stats'","todays-top-10-posters.html",$ibforums->skin['_wrapper']);

// Members List
$ibforums->skin['_wrapper'] = preg_replace("'index.php\?act=Members'","member-list.html",$ibforums->skin['_wrapper']);


// Calendar
$ibforums->skin['_wrapper'] = preg_replace("'index.php\?act=calendar&CODE=newevent'","add-new-event.html",$ibforums->skin['_wrapper']);
$ibforums->skin['_wrapper'] = preg_replace("'index.php\?act=calendar&CODE=find&what=thismonth'","events-this-month.html",$ibforums->skin['_wrapper']);
$ibforums->skin['_wrapper'] = preg_replace("'index.php\?act=calendar&CODE=find&what=thisweek'","events-this-week.html",$ibforums->skin['_wrapper']);
$ibforums->skin['_wrapper'] = preg_replace("'index.php\?act=calendar&m=([0-9]*)&y=([0-9]*)'","go-to-month-\\1-\\2.html",$ibforums->skin['_wrapper']);
$ibforums->skin['_wrapper'] = preg_replace("'index.php\?act=calendar&CODE=showweek&week=([0-9]*)'","show-week-\\1.html",$ibforums->skin['_wrapper']);
$ibforums->skin['_wrapper'] = preg_replace("'index.php\?act=calendar&CODE=showday&y=([0-9]*)&m=([0-9]*)&d=([0-9]*)'","show-day-\\3-\\2-\\1.html",$ibforums->skin['_wrapper']);
$ibforums->skin['_wrapper'] = preg_replace("'index.php\?&act=calendar&CODE=showday&y=([0-9]*)&m=([0-9]*)&d=([0-9]*)'","show-day-\\3-\\2-\\1.html",$ibforums->skin['_wrapper']);

$ibforums->skin['_wrapper'] = preg_replace("'index.php\?act=calendar'","calendar.html",$ibforums->skin['_wrapper']);
$ibforums->skin['_wrapper'] = preg_replace("'index.php\?&act=calendar'","calendar.html",$ibforums->skin['_wrapper']);


class FURL {
  function FURL()
  {

}

function create_create_topic_url($fid){
global $DB;
$DB->simple_construct( array( 'select' => '*', 'from' => 'forums', 'where' => 'id ='.$fid ));
      $DB->simple_exec();
if ($row = $DB->fetch_row()) {
$forum = $row;
$forum['name'] = $this->make_text_safe($forum['name']);
return $forum['name']."-new-topic-f{$fid}.html";
}
}

function create_create_poll_url($fid){
global $DB;
$DB->simple_construct( array( 'select' => '*', 'from' => 'forums', 'where' => 'id ='.$fid ));
      $DB->simple_exec();
if ($row = $DB->fetch_row()) {
$forum = $row;
$forum['name'] = $this->make_text_safe($forum['name']);
return $forum['name']."-new-poll-f{$fid}.html";
}
}


function create_topic_url($tid,$seite=0){
global $DB;
$DB->simple_construct( array( 'select' => 'title', 'from' => 'topics', 'where' => 'tid ='.$tid ));
     $DB->simple_exec();
if ($row = $DB->fetch_row()) {
$topic = $row;
$topic_name = $this->make_text_safe($topic['title']);
if ($seite!=0) return $topic_name."-t{$tid}-s{$seite}.html\""; else return $topic_name."-t{$tid}.html\"";
}
}


function create_forum_url($fid)
{
global $DB, $ibforums;
$forum = $ibforums->cache['forum_cache'][$fid]['name'];
$forum = $this->make_text_safe($forum);
return $forum."-f{$fid}.html";
}

function create_event_url($eventid){
global $DB;
$DB->simple_construct( array( 'select' => '*', 'from' => 'calendar_events', 'where' => 'eventid ='.$eventid ));
      $DB->simple_exec();
if ($row = $DB->fetch_row()) {
$event = $row;
$event['title'] = $this->make_text_safe($event['title']);
return $event['title']."-e{$eventid}.html";
}
}

function create_help_url($hid){
global $DB;
$DB->simple_construct( array( 'select' => '*', 'from' => 'faq', 'where' => 'id = '.$hid ));
      $DB->simple_exec();
if ($row = $DB->fetch_row()) {
$help = $row;
$help['title'] = $this->make_text_safe($help['title']);
return $help['title']."-h{$hid}.html";
}
}

function create_member_url($mid){
global $DB;
if ($mid != "") {
$member = $this->get_member($mid);
$member['name'] = $this->make_text_safe($member['name']); }
return $member['name']."-m{$mid}.html";
}

function create_member_pm_url($mid){
global $DB;
$member = $this->get_member($mid);
$member['name'] = $this->make_text_safe($member['name']);
return "send-".$member['name']."-a-private-message-m{$mid}.html";
}

function create_member_email_url($mid){
global $DB;
$member = $this->get_member($mid);
$member['name'] = $this->make_text_safe($member['name']);
return "send-".$member['name']."-an-email-m{$mid}.html";
}

function get_member($mid){
global $DB;
$DB->simple_construct( array( 'select' => '*', 'from' => 'members', 'where' => 'id ='.$mid ));
  $DB->simple_exec();
if ($row = $DB->fetch_row()) {
return $row;
}
}

function make_text_safe($text){
//Charachters must be in ASCII and certain ones aint allowed
$text = preg_replace("#&\#([0-9]*);#ie","_",$text);
$text = html_entity_decode ($text);
$text = str_replace(" / ","_",$text);
$text = str_replace("/","_",$text);
$text = str_replace("'","_",$text);
$text = str_replace(" - ","_",$text);
$text = str_replace("-","_",$text);
$text = str_replace(" ","_",$text);
$text = str_replace( "ä", "ae", $text);
$text = str_replace( "ö", "oe", $text);
$text = str_replace( "ü", "ue", $text);
$text = str_replace( "Ä", "Ae", $text);
$text = str_replace( "Ö", "Oe", $text);
$text = str_replace( "Ü", "Ue", $text);
$text = str_replace( "ß", "ss", $text);
$text = str_replace( "&", "and", $text);
$text = str_replace( "%", "Percent", $text);
//Polish Characters
$text = str_replace( "?", "l", $text);
$text = str_replace( "ó", "o", $text);
$text = str_replace( "?", "n", $text);
$text = str_replace( "?", "c", $text);
$text = str_replace( "?", "z", $text);
$text = str_replace( "?", "z", $text);
$text = str_replace( "?", "s", $text);
$text = str_replace( "?", "a", $text);
$text = str_replace( "?", "e", $text);
$text = ereg_replace("[^A-Za-z0-9_]", "", $text);
$text = str_replace("____","_",$text);
$text = str_replace("___","_",$text);
$text = str_replace("__","_",$text);
return $text;
}

}
?>

i tu mi sie wydaje ze jest ok ....

Pozdrawiam, (-;

www.topposition.pl - Top Position

tp468x60_banerrr.png

Odnośnik do komentarza
Udostępnij na innych stronach

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...

Powiadomienie o plikach cookie

Umieściliśmy na Twoim urządzeniu pliki cookie, aby pomóc Ci usprawnić przeglądanie strony. Możesz dostosować ustawienia plików cookie, w przeciwnym wypadku zakładamy, że wyrażasz na to zgodę. Warunki użytkowania Polityka prywatności