phpBB SEO
Boards
Directory  
SEO  
Downloads
  phpBB SEO : Search Engine Optimization, Directory, Forums  
Index
Forums
Annuaire
Référencement
Télécharger
 
  Search Rechercher
    Register
Username :  Password :  Log me on automatically each visit  
S'enregistrer  
 
   
[Archive] phpBB SEO Simple mod Rewrite V 0.0.2
Goto page Previous  1, 2, 3, 4, 5, 6, 7  Next
 
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » phpBB mod Rewrite  » Simple mod rewrite
::  
Author Message
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 13354

[Archive] phpBB SEO Simple mod Rewrite V 0.0.2Posted: Thu Oct 26, 2006 5:08 pm    Post subject: Re: [Archive] phpBB SEO Simple mod Rewrite V 0.0.2

I get it now sorry Laughing

So the french part I did not noticed in the install is just telling you to take a look at the www prefix duplicate and to put your .htaccess in root.

++

_________________
Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche
Back to top
Visit poster's website
HB.
PR0
PR0


Joined: 26 Oct 2006
Posts: 62

[Archive] phpBB SEO Simple mod Rewrite V 0.0.2Posted: Thu Oct 26, 2006 5:11 pm    Post subject: Re: [Archive] phpBB SEO Simple mod Rewrite V 0.0.2

ok thanks, I didn't want to continue with the install not knowing the french part.
Back to top
HB.
PR0
PR0


Joined: 26 Oct 2006
Posts: 62

[Archive] phpBB SEO Simple mod Rewrite V 0.0.2Posted: Thu Oct 26, 2006 5:13 pm    Post subject: Re: [Archive] phpBB SEO Simple mod Rewrite V 0.0.2

sorry forgot to ask

Code:
# PAGINATED FORUM
RewriteRule ^forum([0-9]+)-([0-9]+)-([0-9]+)\.html$ /index.php?f=$1&ppage=$2&start=$3 [QSA,L]
# PAGINATED FORUM
RewriteRule ^forum([0-9]+)-([0-9]+)\.html$ /index.php?f=$1&ppage=$2 [QSA,L]
# FORUM
RewriteRule ^forum([0-9]+)\.html$ /index.php?f=$1 [QSA,L]
# PAGINATED TOPIC
RewriteRule ^topic([0-9]+)-([0-9]+)\.html$ /viewtopic.php?t=$1&start=$2 [QSA,L]
# TOPIC
RewriteRule ^topic([0-9]+)\.html$ /viewtopic.php?t=$1 [QSA,L]
# POST
RewriteRule ^post([0-9]+)\.html$ /viewtopic.php?p=$1 [QSA,L]
#PROFILES
RewriteRule ^membre([0-9]+)\.html$ /profile.php?mode=viewprofile&u=$1 [QSA,L]
# END PHPBB PAGES


when adding these should I leave out the "#" sign?
Back to top
euroman
PR0
PR0


Joined: 21 Oct 2006
Posts: 81

[Archive] phpBB SEO Simple mod Rewrite V 0.0.2Posted: Thu Oct 26, 2006 6:08 pm    Post subject: Re: [Archive] phpBB SEO Simple mod Rewrite V 0.0.2

HB. wrote:
sorry forgot to ask

Code:
# PAGINATED FORUM
RewriteRule ^forum([0-9]+)-([0-9]+)-([0-9]+)\.html$ /index.php?f=$1&ppage=$2&start=$3 [QSA,L]
# PAGINATED FORUM
RewriteRule ^forum([0-9]+)-([0-9]+)\.html$ /index.php?f=$1&ppage=$2 [QSA,L]
# FORUM
RewriteRule ^forum([0-9]+)\.html$ /index.php?f=$1 [QSA,L]
# PAGINATED TOPIC
RewriteRule ^topic([0-9]+)-([0-9]+)\.html$ /viewtopic.php?t=$1&start=$2 [QSA,L]
# TOPIC
RewriteRule ^topic([0-9]+)\.html$ /viewtopic.php?t=$1 [QSA,L]
# POST
RewriteRule ^post([0-9]+)\.html$ /viewtopic.php?p=$1 [QSA,L]
#PROFILES
RewriteRule ^membre([0-9]+)\.html$ /profile.php?mode=viewprofile&u=$1 [QSA,L]
# END PHPBB PAGES


when adding these should I leave out the "#" sign?


I left them in and it works fine.
Back to top
Visit poster's website
HB.
PR0
PR0


Joined: 26 Oct 2006
Posts: 62

[Archive] phpBB SEO Simple mod Rewrite V 0.0.2Posted: Thu Oct 26, 2006 6:20 pm    Post subject: Re: [Archive] phpBB SEO Simple mod Rewrite V 0.0.2

Thanks,

Ok instead of asking questions bit by bit as I go, I guess I'll compile all my questions within 1 posts

I'm assuming all of this gets added to the .htaccess? I looked at another short url MOD like this one before, and they had similar code in the includes/pageheader.php so I didn't want to get confused.
Code:
#########################################################
# PHPBB SEO REWRITE RULES            #
#########################################################
# AUTHOR : DCZ http://www.phpbb-seo.com/
# STARTED : 01/2006
#####################################################
# FORUMS PAGES
########################
# PAGINATED FORUM
RewriteRule ^phpbb/forum([0-9]+)-([0-9]+)-([0-9]+)\.html$ /phpbb/index.php?f=$1&ppage=$2&start=$3 [QSA,L]
# PAGINATED FORUM
RewriteRule ^phpbb/forum([0-9]+)-([0-9]+)\.html$ /phpbb/index.php?f=$1&ppage=$2 [QSA,L]
# FORUM
RewriteRule ^phpbb/forum([0-9]+)\.html$ /phpbb/index.php?f=$1 [QSA,L]
# PAGINATED TOPIC
RewriteRule ^phpbb/topic([0-9]+)-([0-9]+)\.html$ /phpbb/viewtopic.php?t=$1&start=$2 [QSA,L]
# TOPIC
RewriteRule ^phpbb/topic([0-9]+)\.html$ /phpbb/viewtopic.php?t=$1 [QSA,L]
# POST
RewriteRule ^phpbb/post([0-9]+)\.html$ /phpbb/viewtopic.php?p=$1 [QSA,L]
#PROFILES
RewriteRule ^phpbb/membre([0-9]+)\.html$ /phpbb/profile.php?mode=viewprofile&u=$1 [QSA,L]

#####################################################


There are other french commands I don't know what to do with them

Code:
#
#-----[ OPEN ]------------------------------------------
#

viewtopic.php

#
#-----[ FIND ]------------------------------------------
#

//
// Send vars to template
//

#
#-----[ AFTER, ADD ]------------------------------------------
# Dans cette partie, vous pouvez choisir de ne pas utiliser de highlight, ce qui, d'un point de vue du référencment est
# plus efficace, mais cela retire un peu du confort utilisateur.
# Pour ce faire, retirez simplement la variable $highlight_ok dans le prochain [ REPLACE WITH ] et n'appliquez pas celui-ci.
#

// www.phpBB-SEO.com SEO TOOLKIT BEGIN
$highlight_ok = ($highlight !='') ? "&highlight=$highlight" : '';
// www.phpBB-SEO.com SEO TOOLKIT END


Code:
#
#-----[ FIND ]------------------------------------------
#

function append_sid($url, $non_html_amp = false)
{
   global $SID;

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

   return $url;
}

#
#-----[ REPLACE WITH ]------------------------------------------
#
# Dans les modifications suivante, veuillez lire les commentaires. Ils concernent le mod mx Sitemaps
# ( http://boards.phpbb-seo.com/phpbb-seo-mods/mx-site-map-module-vt4.html ) et mxBB Portal.
# Décommentez ou supprimez les lignes de code requises celon votre utilisation.
#

function append_sid($url, $non_html_amp = false)
{
   global $SID;
   // www.phpBB-SEO.com SEO TOOLKIT BEGIN
   global $phpEx;
   $amp = ($non_html_amp) ? '&' : '&';
   $find = array(   $amp.'start=0',
         $amp.'postdays=0',
         $amp.'topicdays=0',
         $amp.'postorder=asc',
         $amp.'order=DESC',
         $amp.'sort=lastpost',
      );
   $url = str_replace ($find, "", $url);
   $urlin = array(   "'(?)index.".$phpEx."\?f=([0-9]+)".$amp."ppage=([0-9]+)".$amp."start=([0-9]+)(".$amp."){0,1}'",
         "'(?)index.".$phpEx."\?f=([0-9]+)".$amp."start=([0-9]+)".$amp."ppage=([0-9]+)(".$amp."){0,1}'",
         "'(?)index.".$phpEx."\?f=([0-9]+)".$amp."ppage=([0-9]+)(".$amp."){0,1}'",
         "'(?)index.".$phpEx."\?f=([0-9]+)(".$amp."){0,1}'",
         "'(?)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}'",
         // mx Sitemaps Module (Paginated Forum URL)
         //"'(?)forum-map([0-9]+)\.html".$amp."start=([0-9]+)(".$amp."){0,1}'",
         // mx Sitemaps Module (mxBB map URL + pagination)
         //"'(?)mx-map\.html".$amp."start=([0-9]+)(".$amp."){0,1}'"
   );
   $urlout = array( "forum\\1-\\2-\\3.html".if_query('\\4')."",
          "forum\\1-\\3-\\2.html".if_query('\\4')."",
          "forum\\1".if_first('\\2').".html".if_query('\\3')."",
          "forum\\1.html".if_query('\\2')."",
          "topic\\1-\\2.html".if_query('\\3')."",
          "topic\\1.html".if_query('\\2')."",
          "post\\1.html".if_query('\\2')."",
                "membre\\1.html".if_query('\\2')."",
          // mx Sitemaps Module (Paginated Forum URL)
          //"forum-map\\1-\\2.html".if_query('\\3')."",
          // mx Sitemaps Module (mxBB map URL + pagination)
          //"mx-map-\\1.html".if_query('\\2').""
      );
   $url = preg_replace($urlin, $urlout, $url);
   $url = str_replace ('?#', '#', $url);
   $url = (substr($url, strlen($url) - 1, 1) == '?') ? substr($url, 0, strlen($url) - 1) : $url;
   // www.phpBB-SEO.com SEO TOOLKIT END

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

   return $url;
}
Back to top
euroman
PR0
PR0


Joined: 21 Oct 2006
Posts: 81

[Archive] phpBB SEO Simple mod Rewrite V 0.0.2Posted: Fri Oct 27, 2006 10:35 am    Post subject: Re: [Archive] phpBB SEO Simple mod Rewrite V 0.0.2

Highlight search still very much active despite following instructions to deactivate it:

viewtopic.php:
Code:

// www.phpBB-SEO.com SEO TOOLKIT BEGIN
'U_VIEW_TOPIC' => append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&start=$start&postdays=$post_days&postorder=$post_order"),
// www.phpBB-SEO.com SEO TOOLKIT END


search.php:
Code:
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
$post_url = append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $searchset[$i]['post_id']) . '#' . $searchset[$i]['post_id'];
// www.phpBB-SEO.com SEO TOOLKIT END


PS When I search for "car" I get the following string:
http://www.thegame-online.de/topic7.html?highlight=car+automobile

BTW How does the system know to highligt automobile also when the search only was for car and the word automobile doest not exist in the forum Shocked
Back to top
Visit poster's website
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 13354

[Archive] phpBB SEO Simple mod Rewrite V 0.0.2Posted: Fri Oct 27, 2006 5:31 pm    Post subject: Re: [Archive] phpBB SEO Simple mod Rewrite V 0.0.2

@ HB.
Sorry, I fixed the translations in the package, please re download it.

And yes, the first piece of code you mention is to be place in an .htaccess file.

It is true Reg-Ex like these are found in many phpBB mod rewrite page_header.php's code changes, but here we use a different method.
There are still some Reg-EX, but they are located in append_sid() (includes/sessions.php) instead.

@ euroman
If car comes highlighted with automobile, it's because of the search_synonyms.txt in the languages folders Wink

Now, the default install, when you apply all changes, only filter the empty highlights but keep the option working.
The commentary in the install file is only here to explain how to totally get rid of the feature.

++

_________________
Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche
Back to top
Visit poster's website
HB.
PR0
PR0


Joined: 26 Oct 2006
Posts: 62

[Archive] phpBB SEO Simple mod Rewrite V 0.0.2Posted: Fri Oct 27, 2006 5:35 pm    Post subject: Re: [Archive] phpBB SEO Simple mod Rewrite V 0.0.2

Thank you very much dcz. I'll download it today, and thank you for explaining the difference. Smile
Back to top
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 13354

[Archive] phpBB SEO Simple mod Rewrite V 0.0.2Posted: Fri Oct 27, 2006 5:38 pm    Post subject: Re: [Archive] phpBB SEO Simple mod Rewrite V 0.0.2

You're welcome Very Happy

I elaborated a bit more here if you're interested.

++

_________________
Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche
Back to top
Visit poster's website
euroman
PR0
PR0


Joined: 21 Oct 2006
Posts: 81

[Archive] phpBB SEO Simple mod Rewrite V 0.0.2Posted: Fri Oct 27, 2006 6:22 pm    Post subject: Re: [Archive] phpBB SEO Simple mod Rewrite V 0.0.2

ok thanks.

I am now moving on to my real forum. the bottom of my sessions fil looks like this: (the code I am supposed to replace is not there)

Quote:
//
// Append $SID to a url. Borrowed from phplib and modified. This is an
// extra routine utilised by the session code above and acts as a wrapper
// around every single URL and form action. If you replace the session
// code you must include this routine, even if it's empty.
//
function append_sid($url, $non_html_amp = false)
{
global $SID, $HTTP_SERVER_VARS;

if ( !empty($SID) && !preg_match('#sid=#', $url) && !strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'Googlebot') && !strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'slurp@inktomi.com;'))


{
$url .= ( ( strpos($url, '?') !== false ) ? ( ( $non_html_amp ) ? '&' : '&' ) : '?' ) . $SID;
}

return $url;
}


I honestly cant remember exactly why it is changed ?? Can I substitute it ?
Back to top
Visit poster's website
euroman
PR0
PR0


Joined: 21 Oct 2006
Posts: 81

[Archive] phpBB SEO Simple mod Rewrite V 0.0.2Posted: Fri Oct 27, 2006 6:37 pm    Post subject: Re: [Archive] phpBB SEO Simple mod Rewrite V 0.0.2

I think its easymod...
Back to top
Visit poster's website
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 13354

[Archive] phpBB SEO Simple mod Rewrite V 0.0.2Posted: Fri Oct 27, 2006 6:43 pm    Post subject: Re: [Archive] phpBB SEO Simple mod Rewrite V 0.0.2

Please use the edit option when adding some commentaries to yourself.

Then you just need to replace the entire append_sid function, it seems you already added a mod filtering SID for some bots, based on user agent :

You can safely overwrite the entire append_sid function as the guest session mod will get rid of all SIDs for guests, thus for bots.

++

_________________
Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche
Back to top
Visit poster's website
HB.
PR0
PR0


Joined: 26 Oct 2006
Posts: 62

[Archive] phpBB SEO Simple mod Rewrite V 0.0.2Posted: Fri Oct 27, 2006 7:04 pm    Post subject: Re: [Archive] phpBB SEO Simple mod Rewrite V 0.0.2

In your includes/sessions instructions

Code:
#
#-----[ FIND ]------------------------------------------
#

function append_sid($url, $non_html_amp = false)
{
   global $SID;

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

   return $url;
}

#
#-----[ REPLACE WITH ]------------------------------------------
#
# In the following code changes, please look at the comments, they concern the
# mx Sitemaps Module ( http://boards.phpbb-seo.com/phpbb-seo-mods/mx-site-map-module-vt4.html )
# and mxBB Portal. Just uncomment, to activate, or delete, if unused, the required lines of code upon your needs
#

function append_sid($url, $non_html_amp = false)
{
   global $SID;
   // www.phpBB-SEO.com SEO TOOLKIT BEGIN
   global $phpEx;
   $amp = ($non_html_amp) ? '&' : '&';
   $find = array(   $amp.'start=0',
         $amp.'postdays=0',
         $amp.'topicdays=0',
         $amp.'postorder=asc',
         $amp.'order=DESC',
         $amp.'sort=lastpost',
      );
   $url = str_replace ($find, "", $url);
   $urlin = array(   "'(?)index.".$phpEx."\?f=([0-9]+)".$amp."ppage=([0-9]+)".$amp."start=([0-9]+)(".$amp."){0,1}'",
         "'(?)index.".$phpEx."\?f=([0-9]+)".$amp."start=([0-9]+)".$amp."ppage=([0-9]+)(".$amp."){0,1}'",
         "'(?)index.".$phpEx."\?f=([0-9]+)".$amp."ppage=([0-9]+)(".$amp."){0,1}'",
         "'(?)index.".$phpEx."\?f=([0-9]+)(".$amp."){0,1}'",
         "'(?)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}'",
         // mx Sitemaps Module (Paginated Forum URL)
         //"'(?)forum-map([0-9]+)\.html".$amp."start=([0-9]+)(".$amp."){0,1}'",
         // mx Sitemaps Module (mxBB map URL + pagination)
         //"'(?)mx-map\.html".$amp."start=([0-9]+)(".$amp."){0,1}'"
   );
   $urlout = array( "forum\\1-\\2-\\3.html".if_query('\\4')."",
          "forum\\1-\\3-\\2.html".if_query('\\4')."",
          "forum\\1".if_first('\\2').".html".if_query('\\3')."",
          "forum\\1.html".if_query('\\2')."",
          "topic\\1-\\2.html".if_query('\\3')."",
          "topic\\1.html".if_query('\\2')."",
          "post\\1.html".if_query('\\2')."",
                "membre\\1.html".if_query('\\2')."",
          // mx Sitemaps Module (Paginated Forum URL)
          //"forum-map\\1-\\2.html".if_query('\\3')."",
          // mx Sitemaps Module (mxBB map URL + pagination)
          //"mx-map-\\1.html".if_query('\\2').""
      );
   $url = preg_replace($urlin, $urlout, $url);
   $url = str_replace ('?#', '#', $url);
   $url = (substr($url, strlen($url) - 1, 1) == '?') ? substr($url, 0, strlen($url) - 1) : $url;
   // www.phpBB-SEO.com SEO TOOLKIT END

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

   return $url;
}


Is this portion removing sids for guests? I already have a sid removal MOD applied and it appears that it's causing a conflict. I'm not able to located the entire code. I'm wondering if I should remove the sid MOD? Also, I did read you statement about the mx sitemap, if I don't have that MOD installed already, would that cause conflict with all that code there? Or, should I install the sitemap MODs first then come back to this one?
Back to top
gowap
phpBB SEO Team
phpBB SEO Team


Joined: 07 May 2006
Posts: 990

[Archive] phpBB SEO Simple mod Rewrite V 0.0.2Posted: Fri Oct 27, 2006 9:59 pm    Post subject: Re: [DEV] phpBB SEO Simple mod Rewrite V 0.0.2

phpbb-seo mods do not remove sids for guests themselves.
The documentation (see first post of this topic) advise :
SeO wrote:
Don't forget to install the Cyber alien Guest session mod or any other SID removal method you may prefer.

If I were you, i would take a vanilla phpbBB 2.0.21 sessions.php file, apply cyberalien's guest session mod to it and then the phpbb-seo rewrite mod.

Don't be scared about some references to the mx sitemaps mod in the code snippet you posted. If you just want rewrite, you do not need to install mx sitemaps module (or mx google sitemaps) first. There will be no conflict.

_________________
Gravure-News : la communauté francophone de la gravure de CD/DVD et son forum d'entraide.
Back to top
Visit poster's website
HB.
PR0
PR0


Joined: 26 Oct 2006
Posts: 62

[Archive] phpBB SEO Simple mod Rewrite V 0.0.2Posted: Sat Oct 28, 2006 2:12 am    Post subject: Re: [Archive] phpBB SEO Simple mod Rewrite V 0.0.2

Cyber Alien's sid removal mod gets rid of this line in the sessions file. Should I reverse that edit, then apply the edit for this mod?

Code:
$SID = 'sid=' . $session_id;


edit: his part of the mod calls for:

Code:
#
#-----[ FIND ]---------------------------------------------
# around line 210
   $SID = 'sid=' . $session_id;

#
#-----[ REPLACE WITH ]---------------------------------------
#
   $SID = $user_id > 0 ? 'sid=' . $session_id : '';


For this mod the code instructions read
Code:
#
#-----[ FIND ]------------------------------------------
#
   $SID = 'sid=' . $session_id;
#
#-----[ REPLACE WITH ]------------------------------------------
#

   // www.phpBB-SEO.com SEO TOOLKIT BEGIN
   if ( $userdata['session_user_id'] != ANONYMOUS || $userdata['session_page'] == -4 || $userdata['session_page'] == -2 )
      $SID = 'sid=' . $session_id;
   else
      $SID = '';
   // www.phpBB-SEO.com SEO TOOLKIT END
Back to top
Display posts from previous:   
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » phpBB mod Rewrite  » Simple mod rewrite
Page 5 of 7 Goto page Previous  1, 2, 3, 4, 5, 6, 7  Next

Navigation Similar Topics

Jump to: