SEO URL V2 tweak

The GYM Sitemaps and RSS module and it's plug-ins.
Google Yahoo MSN Sitemaps (United 0.9).
RSS 2.0 Feeds and Yahoo! urllist.txt.

Moderator: Moderators

SEO URL V2 tweak

Postby eMWu » Thu Mar 15, 2007 1:35 pm

Hi there,

I'm trying to use your sitemap mod along with SEO URLs V2 by mgutt.
So far I figured out I had to switch to Advanced rewriting type and replace
Code: Select all
$this->seo_delim = array('cat' => '-vc',
   'forum' => '-vf',
   'topic' => '-vt',
   'user' => '-u'

with
Code: Select all
$this->seo_delim = array('cat' => '-c',
   'forum' => '-f',
   'topic' => '-t',
   'user' => '-u'


I think I only have one small problem left. In sitemap the character (html code: ’) is replaced by - while my mod just removes it. I want sitemap to remove it too.
So I want a topic with title My dog's bone
use url my-dogs-bone-t123.html
instead of my-dog-s-bone-t123.html
eMWu
 
Posts: 5
Joined: Thu Mar 15, 2007 1:23 pm

Advertisement

Postby dcz » Fri Mar 16, 2007 11:49 am

And welcome :D

You did well in understanding where to tweak the urls ;)

The problem with SEO urlV2 mod is that it's not really designed to be easily extended, as there is no equivalent to format_url function, the title filtering is just performed straight in the append_sid code.

So, you'll have to mod a bit the format_url function to fit your needs.

If the ' is the only character to casue problem, juste open ggs_function.php and find :

Code: Select all
         $url = str_replace ('ß', 'ss', $url);


Before add :

Code: Select all
         $url = str_replace ("'", '', $url);


About the url standard itself, I think you'd need to additionnaly change :

Code: Select all
            'start' => '-',


with :
Code: Select all
            'start' => ',start,',


as seo url is building urls like : topic-title,start,15.html if I recall well.


To conclude, I think you could consider migrating to our rewriting method, to be able to use the zero duplicate mod ;)

++
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

Postby eMWu » Sun Mar 18, 2007 9:35 pm

thanks for the reply!
I had successfully fixed the issue with character
Code: Select all
'


But trying to do the same for character
Code: Select all
didn't work.
I tried various ways of trying to disable replacing that character with a dash. I added these lines:
Code: Select all
         $url = str_replace ("’", '', $url);
         $url = str_replace ("’", '', $url);
         $url = str_replace ("’", '', $url);

But still the character ’ is being replaced with - :(

I also added this line:
Code: Select all
$url = str_replace ("&", 'and', $url);
since SEO URLs V2 replaces character & with -and- but there's no change :(
eMWu
 
Posts: 5
Joined: Thu Mar 15, 2007 1:23 pm

Postby dcz » Mon Mar 19, 2007 10:14 pm

& (& amp;) is dealt with at this stage :

Code: Select all
      $find = array('"','&','<','>','\r\n','\n',);


So the easiest would eb to deal with your extra filtering before this one, and delete :
Code: Select all
'&',

in this line.
It does not work with the ’ if you replace :

Code: Select all
$url = str_replace ("'", '', $url);


with :

Code: Select all
$url = str_replace (array("'", "’"), '', $url);


?
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

Postby eMWu » Mon Mar 19, 2007 10:54 pm

thanks again for taking your time to reply!
The & issue is now solved by removing the part you suggested and adding line
Code: Select all
$url = str_replace ('&', 'and', $url);


But for some reason the character is a tricky one!
I replaced my previous additions with your line:
Code: Select all
$url = str_replace (array("'", "’"), '', $url);
and ' gets replaced properly but doesn't :shock:
eMWu
 
Posts: 5
Joined: Thu Mar 15, 2007 1:23 pm

Postby dcz » Mon Mar 19, 2007 11:49 pm

Try with ’ then, must be htmlspecialchared.

And make sure you do it where you first put the ' replacement.

Should work.

++
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

Postby eMWu » Tue Mar 20, 2007 12:34 am

I tried that before.
I gave it another try now, using:
Code: Select all
$url = str_replace (array("’", "'"), '', $url);

but it still doesn't work :(

But thanks for trying to help.
eMWu
 
Posts: 5
Joined: Thu Mar 15, 2007 1:23 pm

Postby eMWu » Tue Mar 20, 2007 10:01 pm

yay I finally managed to find a solution! :)
the correct code should be:
Code: Select all
$url = str_replace (array("'", chr(146)), '', $url);
eMWu
 
Posts: 5
Joined: Thu Mar 15, 2007 1:23 pm

Postby dcz » Wed Mar 21, 2007 2:15 pm

So we have the clue about how to use GYM sitemaps with SEO url v2 :D
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: SEO URL V2 tweak

Postby dr_somm » Tue Mar 03, 2009 11:29 pm

That tweak works fine for me - except in sitemap.php.

The links look like this:
-http://www.domain.de/forum-gf1.xml

instead of this:
-http://www.domain.de/forum-f1.xml

Plus they are all dead links - even when formatted correctly. :|

[e] My .htaccess:

Code: Select all
<Files config.php>
Deny from all
</Files>

DirectoryIndex index.html index.htm index.php

RewriteEngine On

# SEO URL [mgutt]
RewriteRule !\.html$ - [L]
RewriteRule ^[a-z0-9-]+-([pt])([0-9]+)\.html$ /viewtopic.php?$1=$2 [L]
RewriteRule ^[a-z0-9-]+-f([0-9]+)\.html$ /viewforum.php?f=$1 [L]
RewriteRule ^[a-z0-9-]+-c([0-9]+)\.html$ /index.php?c=$1 [L]
RewriteRule ^[a-z0-9-]+-u([0-9]+)\.html$ /profile.php?mode=viewprofile&u=$1 [L]
RewriteRule ^([a-zA-Z0-9_]+),([^/,]+),([^/,]*)([^/]*\.html)$ $1$4?$2=$3 [QSA,N]
RewriteRule ^[a-z0-9-]+-([pt])([0-9]+),([^/,]+),([^/,]*)([^/]*\.html)$ viewtopic$5?$1=$2&$3=$4 [QSA,N]
RewriteRule ^[a-z0-9-]+-f([0-9]+),([^/,]+),([^/,]*)([^/]*\.html)$ viewforum$4?f=$1&$2=$3 [QSA,N]
RewriteRule ^([a-zA-Z0-9_]+)\.html$ /$1.php [L]

#########################################################
# GYM SITEMAPS AND RSS REWRITE RULES         #
#########################################################
# AUTHOR : dcz http://www.phpbb-seo.com/
# STARTED : 2006/02/22
########################
# RSS main
RewriteRule ^rss-?(l|s)?-?(m)?\.(xml(\.gz)?)$ /rss.php?$1&$2 [L]
# RSS forums
RewriteRule ^forums-rss-?(l|s)?-?(m)?\.(xml(\.gz)?)$ /rss.php?forum&c&$1&$2 [L]
# RSS all
RewriteRule ^([a-zA-Z0-9_-]+)-rss([0-9]*)-?(l|s)?-?(m)?\.(xml(\.gz)?)$ /rss.php?$1=$2&$3&$4 [L]
# RSS forum topics
RewriteRule ^.+-rf([0-9]+)-?(l|s)?-?(m)?\.(xml(\.gz)?)$ /rss.php?forum=$1&$2&$3 [L]
# SitemapIndex
RewriteRule ^sitemaps\.(xml(\.gz)?)$ /sitemap.php [L]
# Sitemap modules
RewriteRule ^([a-zA-Z0-9_-]+)-sitemap\.(xml(\.gz)?)$ /sitemap.php?$1 [L]
# Forum Sitemaps
RewriteRule ^.+-gf([0-9]+)\.(xml(\.gz)?)$ /sitemap.php?forum=$1 [L]
# Yahoo! urllist.txt
RewriteRule ^urllist\.(txt(\.gz)?)$ /urllist.php [L]
#########################################################
# END GYM SITEMAPS AND RSS REWRITE RULES      #
#########################################################
dr_somm
 
Posts: 29
Joined: Sun Mar 01, 2009 9:27 pm

Re: SEO URL V2 tweak

Postby dr_somm » Wed Mar 04, 2009 11:44 am

Now that I've put the sitemap rewrite rules before the other code it works (partially):

- mydomain.com/sitemap.xml still doesn't work; mydomain.com/sitemap.php does;

- some links in sitemap.php look different than the ones created by the forum rewrite mod, e.g.:
topic name: "[FAQ] Create your own quiz"
sitemap rewrite:http://www.mydomain.com/create-your-own-quiz-t4183.html
forum rewrite:http://www.mydomain.com/faq-create-your-own-quiz-t4183.htm

or

topic name: "Alejandro González Iñárritu"
sitemap rewrite:http://www.mydomain.com/alejandro-gonzalez-inarritu-t4210.html
forum rewrite:http://www.mydomain.com/alejandro-gonzlez-irritu-t4210.html

Guess that's only a cosmetic problem though - both links are working. Or does google consider that as double content?

Another problem is, that any changes applied in "RSS content settings" (ACP), like "Message text" or "Allow active links", don't have any impact on the actual rss-page. It always looks the same: a list of recent postings with forum links.
dr_somm
 
Posts: 29
Joined: Sun Mar 01, 2009 9:27 pm

Re: SEO URL V2 tweak

Postby SeO » Wed Mar 04, 2009 7:21 pm

Well, are you sure it would not be better to convert to phpBB3 ?

Adding :
Code: Select all
Options -MultiViews

At the beginning of your .htaccess may help in case you have physical sitemap.xml and / or rss.xml files at the same level as the sitemap.php and rss.php file (deleting the .xml could help out to).

For the url formating, you can remove this line in mx_ggsitemaps/includes/ggs_functions.php :
Code: Select all
         $url = preg_replace("(\[.*\])U","",$url);

Will fix the [faq] bit.
But for the other case, where ñ is just deleted by SEO mod V2, oh well, shouldn't it be the way it is done by GYM ?
Another pro for converting, or to go for our phpBB2 SEO mod, since the zero duplicate would take care about duplicate reduction.
Maybe you can try to use the SEO mod V2 code for url formatting instead of the one in
Code: Select all
      function format_url

in the same file.
SeO
Admin
Admin
 
Posts: 6333
Joined: Wed Mar 15, 2006 9:41 pm

Re: SEO URL V2 tweak

Postby dr_somm » Wed Mar 04, 2009 7:44 pm

Thank you for your reply!

I guess it's easier to switch to your SEO mod then. If I remember correctly (I already used that one on a test board) it didn't properly translate some German special characters like "ß", "ä", "ö" and "ü" though.

Regarding phpBB3: So far, a conversion to phpBB3 is not an option. My forum is highly customized (http://www.quentintarantino.de) - plus I don't like the tableless design of phpBB3 (Google neither btw ;)).
dr_somm
 
Posts: 29
Joined: Sun Mar 01, 2009 9:27 pm

Re: SEO URL V2 tweak

Postby dr_somm » Wed Mar 04, 2009 8:10 pm

Sorry for the double post :roll:

Just one last question: After installing your mod, do I have to bother about redirecting the URLs of the old seo mod to the new ones?
dr_somm
 
Posts: 29
Joined: Sun Mar 01, 2009 9:27 pm

Re: SEO URL V2 tweak

Postby dcz » Tue Mar 10, 2009 2:24 pm

dr_somm wrote:Regarding phpBB3: So far, a conversion to phpBB3 is not an option. My forum is highly customized (http://www.quentintarantino.de) - plus I don't like the tableless design of phpBB3 (Google neither btw ;)).


The fact that google is not able to perfectly display the translation of a page does not mean much as far as is google liking the page, and besides, the display is very close to perfection.
And you can use subsilver2 for a table based design with phpBB3 so, only your heavy modifications can require some work to convert, but still, IMHO it's worth it.
Because you could reach the point where converting would become a must (php5 or 6 for example), and at this point, you would loose all the efforts invested on phpBB2 (starting from let's say now), which could as well be as much as what would require a anticipated conversion.

Anyway, for the german characters, give search a chance, the topic was already covered in the phpBB SEO forums.

Same for redirecting the old SEO URL V2 mod urls, the principle is simple, you'll just need to keep the old rewriterules up and running at the end of your .htaccess to let the zero duplicate do its job.

I'd prefer to see the last touch as 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: 21219
Joined: Fri Apr 28, 2006 9:03 pm

Next

Return to GYM Sitemaps phpBB2

Who is online

Users browsing this forum: No registered users and 1 guest