How to rewrite

phpBB3 SEO Advanced mod Rewrite support forum.
This mods performs URL rewriting for phpBB, injecting forums and topic titles in their URLs.

Moderator: Moderators

How to rewrite

Postby Hexcode » Tue Mar 09, 2010 10:17 am

Hey,
when i have the topic_id and topic_name and the forum_id how can I rewirte it for seo?
for forums the command is $phpbb_seo->seo_url['forum'][$row['forum_id']] is there any similar vor topics?
Hexcode
 
Posts: 23
Joined: Sat Mar 06, 2010 11:28 am

Advertisement

Re: How to rewrite

Postby dcz » Tue Mar 09, 2010 2:49 pm

Example in search.php :
Code: Select all
         // www.phpBB-SEO.com SEO TOOLKIT BEGIN
         $phpbb_seo->set_url($row['forum_name'], $u_forum_id, $phpbb_seo->seo_static['forum']);
         $phpbb_seo->prepare_iurl($row, 'topic', $row['topic_type'] == POST_GLOBAL ? $phpbb_seo->seo_static['global_announce'] : $phpbb_seo->seo_url['forum'][$u_forum_id]);
         // www.phpBB-SEO.com SEO TOOLKIT END

So it $row is holding the topic AND forum info (eg forum_name, forum_id) and you fill $u_forum_id with the forum id, then all calls to append_sid() using $phpbb_root_path and providing with forum and topic id will be rewritten in all cases.
If the query does not retrieve all topic fields, then it must at least select topic_id, topic_title, topic_type, forum_id, and topic_url when SQL rewriting is activated (* works in all cases).
For the forum_name, if you did not select it also, by joining the forum table, it will still work if :
  1. you use SQL rewriting and the listed topics have an url in db (eg they are all synched (it's always the case when first synched)
  2. you do not use virtual folders, and in such case, you should use :
    Code: Select all
             // www.phpBB-SEO.com SEO TOOLKIT BEGIN
             $phpbb_seo->prepare_iurl($row, 'topic', '');
             // www.phpBB-SEO.com SEO TOOLKIT END
  3. all your forum urls are cached and you could then use :
    Code: Select all
             // www.phpBB-SEO.com SEO TOOLKIT BEGIN
             $parent_forum = $row['topic_type'] == POST_GLOBAL ? $phpbb_seo->seo_static['global_announce'] : (!empty($phpbb_seo->seo_url['forum'][$u_forum_id]) ? $phpbb_seo->seo_url['forum'][$u_forum_id] : false);
             if ($parent_forum) {
                $phpbb_seo->prepare_iurl($row, 'topic', $parent_forum);
             }
             // www.phpBB-SEO.com SEO TOOLKIT END
Of course, it's always better to query for all the info that could be required and to use the first bit of code, but it can be handy to specialize the code to your needs to make less code changes.

For example, with SQL rewiring, you pretty much have the url in the topic_url field, making it very easy to even rewrite it outside of phpBB (and without the phpBB SEO class loaded) since you just need to append the topic id and topic url extension to have the full story in all cases (except of course when you would not use SQL rewriting).

++
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: 21219
Joined: Fri Apr 28, 2006 9:03 pm

Re: How to rewrite

Postby Hexcode » Tue Mar 09, 2010 3:04 pm

Works fine ;)
See here -> http://www.script-base.eu/feed.php

But first: Why its writen url.eu/forum-name/topic-txx.html and not url.eu/forum-name/topic-name-txx.html ?

And when I'm search the links is url.eu/postxxx.html ?
Why there is not the normal link?
Hexcode
 
Posts: 23
Joined: Sat Mar 06, 2010 11:28 am

Re: How to rewrite

Postby dcz » Tue Mar 09, 2010 3:11 pm

Why not using GYM feeds : rss/digest/rss.xml , rss/news/rss.xml , rss/rss.xml ...
They are a lot more optimized than phpBB ones, and :
Hexcode wrote:But first: Why its writen url.eu/forum-name/topic-txx.html and not url.eu/forum-name/topic-name-txx.html ?

Not so sure, but it could be because you do not provide with topic_title (and topic_url) to phpbb_seo::prepare_iurl, make sure you use an array containing these and the topic_id.

Hexcode wrote:And when I'm search the links is url.eu/postxxx.html ?
Why there is not the normal link?

This is because it's not so simple to translate post to topic urls, would require more SQL and would probably be not worth it since a) bot do not search and b) the zero dupe handles the matter.

++
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: 21219
Joined: Fri Apr 28, 2006 9:03 pm

Re: How to rewrite

Postby Hexcode » Tue Mar 09, 2010 3:24 pm

You are right topic_title was not there, only post_subject so I add topic_title with
Code: Select all
$row['topic_title'] = $row['post_subject'];

And im using GYM but I like the normal phpBB Feeds more, because your feeds are in some cases a little bit silly...

Mhhn... your SEO Mod is very fine but the GYM mod is not that what im searching for... is there a way to disalbe all things but leave a simple xml sitemap?
Hexcode
 
Posts: 23
Joined: Sat Mar 06, 2010 11:28 am

Re: How to rewrite

Postby dcz » Tue Mar 09, 2010 4:04 pm

Hexcode wrote:And im using GYM but I like the normal phpBB Feeds more, because your feeds are in some cases a little bit silly...


Could you elaborate please?
And yes you can deactivate GYM rss, just use the install link in GYM RSS acp and unsinstall all RSS modules.
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: 21219
Joined: Fri Apr 28, 2006 9:03 pm

Re: How to rewrite

Postby Hexcode » Tue Mar 09, 2010 9:44 pm

the rss of phpbb is in my opinion more user friendly, because there aren't so many different rss feeds. Your rss addon is quite good too, but with all the features it is to big and heavy. Or is there a way to use your rss exactly in that way how the normal rss feed works?
Hexcode
 
Posts: 23
Joined: Sat Mar 06, 2010 11:28 am

Re: How to rewrite

Postby SeO » Wed Mar 10, 2010 8:16 am

Well, GYM is the one ready to deliver unlimited feeds without crashing the server, but of course, this is only critical for big forums (very big ones).
It is also the one to never output duplicates and will be the one to take the most advantage of your server capabilities (since you can accurately tune it up).

Concerning the usability, have you noticed that you can choose the options for the links shown everywhere (footer, auto discovery etc), so you can't really say it's not user friendly, since you can choose the default feed to promote (not to mention xsl styling being also user-friendly).
In addition, you can include messages content with advanced bbcode link and email filtering and with accurate limited output : gym-sitemaps-rss/news/digest/forum.xml
And it's fast too :
Code: Select all
<!-- URL list generated in  0.01723 s ( Mem Usage : 692.82 Kb ) - 8 sql - 15 URLs listed -->
<!--  Output started from cache after 0.00395 s - 2 sql -->
<!--  Output from cache ended up after 0.00470 s - 2 sql -->

0.00395 second waiting before content is sent to the browser from cache ;)

So yes, it may be a complex mod because it has many features, but it's also the kind of mod that will not let you down in your forum's life : Biggest sitemap challenge : Beat the Record! [ 35,001 urls ]
SeO
Admin
Admin
 
Posts: 6333
Joined: Wed Mar 15, 2006 9:41 pm

Re: How to rewrite

Postby Hexcode » Wed Mar 10, 2010 12:33 pm

I said not that it is a bad mod, it's very good ;)
But is there a way to set the Sitemaps to xml without any formating?
Or is this not relevant for google in which format the sitemap is shown?

And here http://www.script-base.eu/miscellaneous ... rum.xml.gz in the description ->
<b>Statistik</b> : 2 Themen || 2 Beiträge
Letzte Antwort von Hexcode
why there is the <b></b> is there a way to change this so that the text is realy writen bold?
Hexcode
 
Posts: 23
Joined: Sat Mar 06, 2010 11:28 am

Re: How to rewrite

Postby SeO » Wed Mar 10, 2010 12:57 pm

We're going off topic here, but since you ask, you can only have the full output (with interpreted html) if you use the xsl styling. Note that the xml will stay escaped as it should and that you also have an option to remove all html from feed output.

For the sitemap styling, google does not care at all about xsl style sheets, and you can deactivate it from acp if you prefer.
SeO
Admin
Admin
 
Posts: 6333
Joined: Wed Mar 15, 2006 9:41 pm

Re: How to rewrite

Postby Hexcode » Wed Mar 10, 2010 2:55 pm

I have added
Code: Select all
$chan_desc = strip_tags($chan_desc);

In gym_rss.php after
Code: Select all
   function parse_channel($chan_title, $chan_desc, $chan_link, $lastBuildDate = 0, $chan_image = '', $chan_source = '') {
      global $config, $user;

Works fine for me ;)
Hexcode
 
Posts: 23
Joined: Sat Mar 06, 2010 11:28 am

Re: How to rewrite

Postby SeO » Thu Mar 11, 2010 8:59 am

Don't you see the option for this in acp : RSS => content => HTML filter ;)
SeO
Admin
Admin
 
Posts: 6333
Joined: Wed Mar 15, 2006 9:41 pm

Re: How to rewrite

Postby Hexcode » Thu Mar 11, 2010 12:16 pm

I see this, but than in the text of the rss the html tags are stripped too, with my code, only the first headline is stripped.
Hexcode
 
Posts: 23
Joined: Sat Mar 06, 2010 11:28 am

Re: How to rewrite

Postby Mag » Thu Jun 30, 2011 9:28 pm

Dear Seo,
I use phpbb 3.0.8
How can i closed feed.php from phpbb.Because i use gyp sitemap & rss feed V 2.0.2.
I realized I do not need a feed.php.

Now,
1-can i delete feed.php?
2-replace it with 404 page?
3-Disallow: /feed.php on robots.txt?
4-or redirect RSS Feed page?
5-phpbb acp ATOM feed: close

Which one do well?
Thank you for reply
Mag
 
Posts: 14
Joined: Sun May 29, 2011 9:00 am


Return to Advanced SEO URL

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 3 guests