Problem with mixed mod rewrite

Discussions and support about the different URL Rewriting techniques for phpBB2.

Moderator: Moderators

Problem with mixed mod rewrite

Postby thekiller20 » Sun Jan 21, 2007 2:02 am

help me please ... i`v done all the things by the boock and mod rewrite still not worcking.
this are my actual configuration files.
the .htacces
Code: Select all
# FORUMS PAGES
########################
# FORUM PROTECTION RULE
RewriteRule ^forum/.+/([^/]+\.html)$ /forum/index.php [R=301,L]
# CATEGORIES
RewriteRule ^forum/.+-vc([0-9]+)\.html$ /forum/index.php?c=$1 [QSA,L]
# PAGINATED FORUM
RewriteRule ^forum/.+-vf([0-9]+)-([0-9]+)\.html$ /forum/viewforum.php?f=$1&start=$2 [QSA,L]
# FORUM
RewriteRule ^forum/.+-vf([0-9]+)\.html$ /forum/viewforum.php?f=$1 [QSA,L]
# PAGINATED TOPIC
RewriteRule ^forum/topic([0-9]+)-([0-9]+)\.html$ /forum/viewtopic.php?t=$1&start=$2 [QSA,L]
# TOPIC
RewriteRule ^forum/topic([0-9]+)\.html$ /forum/viewtopic.php?t=$1 [QSA,L]
# POST
RewriteRule ^forum/post([0-9]+)\.html$ /forum/viewtopic.php?p=$1 [QSA,L]
#PROFILES
RewriteRule ^forum/member([0-9]+)\.html$ /forum/profile.php?mode=viewprofile&u=$1 [QSA,L]
# END forum PAGES
#####################################################

the forum is located in subfolder
here is the sessions.php
Code: Select all
function append_sid($url, $non_html_amp = false)
{
   global $SID;   
   global $phpEx, $seo_cat_name, $seo_forum_name;
   $amp = ($non_html_amp) ? '&' : '&';
   $find = array(   $amp.'start=0',
         $amp.'postdays=0',
         $amp.'topicdays=0',
         $amp.'postorder=asc',
      );
   $url = str_replace ($find, "", $url);
   if ( $seo_cat_name ) {
      $urlin = array( "'(?)index.".$phpEx."\?c=([0-9]+)(".$amp."){0,1}'",
            // mx Sitemaps Module (cat URL injection)
            "'(?)sitemaps([0-9]+)\.html(".$amp."){0,1}'",
         );
      $urlout = array( "".format_url($seo_cat_name)."-vc\\1.html".if_query('\\2')."",
            // mx Sitemaps Module (cat URL injection)
            "".format_url($seo_cat_name)."-sc\\1.html".if_query('\\2')."",
         );
      $url = preg_replace($urlin, $urlout, $url);
   }
   if ( $seo_forum_name ) {
      $urlin = array( "'(?)viewforum.".$phpEx."\?f=([0-9]+)".$amp."start=([0-9]+)(".$amp."){0,1}'",
            "'(?)viewforum.".$phpEx."\?f=([0-9]+)(".$amp."){0,1}'",
            // mx Sitemaps Module (forum URL injection + pagination)
            "'(?)forum-map([0-9]+)\.html".$amp."start=([0-9]+)(".$amp."){0,1}'",
            "'(?)forum-map([0-9]+)\.html(".$amp."){0,1}'",
         );
      $urlout = array( "".format_url($seo_forum_name)."-vf\\1-\\2.html".if_query('\\3')."",
            "".format_url($seo_forum_name)."-vf\\1.html".if_query('\\2')."",
            // mx Sitemaps Module (forum URL injection + pagination)
            "".format_url($seo_forum_name)."-fmp\\1-\\2.html".if_query('\\3')."",
            "".format_url($seo_forum_name)."-fmp\\1.html".if_query('\\2')."",
         );
      $url = preg_replace($urlin, $urlout, $url);
   }
   $urlin = array( "'(?)viewtopic.".$phpEx."\?t=([0-9]+)".$amp."start=([0-9]+)(".$amp."){0,1}'",
         "'(?)viewtopic.".$phpEx."\?t=([0-9]+)(".$amp."){0,1}'",   
               "'(?)viewtopic.".$phpEx."\?p=([0-9]+)(".$amp."){0,1}'",
         "'(?)profile.".$phpEx."\?mode\=viewprofile".$amp."u=([0-9]+)(".$amp."){0,1}'",
         );
   $urlout = array( "topic\\1-\\2.html".if_query('\\3')."",
         "topic\\1.html".if_query('\\2')."",
         "post\\1.html".if_query('\\2')."",   
         "member\\1.html".if_query('\\2')."",
      );
   $url = preg_replace($urlin, $urlout, $url);
   $url = (substr($url, strlen($url) - 1, 1) == '?') ? substr($url, 0, strlen($url) - 1) : $url;

   if ( !empty($SID) && !preg_match('#sid=#', $url) )
   {
      $url .= ( ( strpos($url, '?') !== false ) ?  ( ( $non_html_amp ) ? '&' : '&' ) : '?' ) . $SID;
   }

   return $url;
}


the steps that i made :
i removed the session id ...
next i had installed the mx Sitemaps
then the mixed mod ... i double cheked the installation .. there is no mistake .. but there is a problem my generated links don`t work..
my site url is (i deleted the account )

P.S i`m sorry for my bad eanglish.... it has been a wile since i wrote last time . thanks.
Last edited by thekiller20 on Sun Jan 21, 2007 11:54 am, edited 2 times in total.
thekiller20
 
Posts: 3
Joined: Sun Jan 21, 2007 1:48 am

Advertisement

Postby dcz » Sun Jan 21, 2007 2:08 am

And welcome :D

Simple question to start with, you did put :
Code: Select all
RewriteEngine on
RewriteBase /


in your .htaccess, and put it in your domain's root folder (eg one level above forum/) ?
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21325
Joined: Fri Apr 28, 2006 9:03 pm

Postby thekiller20 » Sun Jan 21, 2007 2:10 am

yes i did...
Code: Select all
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
thekiller20
 
Posts: 3
Joined: Sun Jan 21, 2007 1:48 am

Postby dcz » Sun Jan 21, 2007 2:33 am

Ok, so the .htaccess is at the domain's root level too.

Are you sure you've got the mod_rewrtie module on your server?

If so try getting rid of :

Code: Select all
Options +FollowSymlinks


As well, you can try getting rid of the "/" at the beginning of forum/ like this :
Code: Select all
RewriteRule ^forum/.+-vc([0-9]+)\.html$ forum/index.php?c=$1 [QSA,L]


If nothing works, chances are great that you do not have the mod_rewrite module on your server.

Because, all this only deals with it now, as the links are all rewritten well.

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21325
Joined: Fri Apr 28, 2006 9:03 pm

Postby thekiller20 » Sun Jan 21, 2007 11:52 am

yes you are right mod_rewrite is of .... i just asked the admin.
thanks for your suport.
thekiller20
 
Posts: 3
Joined: Sun Jan 21, 2007 1:48 am


Return to phpBB2 mod Rewrite

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 2 guests


 
cron