Seite 8 von 17

Re: [DEV] SEO URLs

Verfasst: 19.11.2015 12:04
von darkeyeX
Gibt es vllt eine andere SEO Ext die das kann? ich habe seit 10 Jahren ein Forum mit dieser Url Struktur, und möchte sehr ungerne darauf verzichten.
Dabei würde ich so gerne auf 3.1. updaten

Re: [DEV] SEO URLs

Verfasst: 19.11.2015 12:40
von tas2580
So weit ich weiß gibt es zur Zeit für phpBB 3.1 keine andere Extension die URLs umschreibt. Du kannst aber diese Extension so abändern das sie URLs nach deinem Muster ausgibt. Das Problem ist dann nur das du die Änderung bei jedem Update wieder neu machen musst. Außerdem solltest du beachten das die Extension noch an einigen Stellen Probleme macht. Wenn du es trotzdem versuchen willst:

Öffne die event/listener.php im Ordner der Extension und suche dort:

Code: Alles auswählen

    private function generate_topic_link($forum_id, $forum_name, $topic_id, $topic_title, $start = 0, $full = false)
    {
        if ($full)
        {
            return generate_board_url() . '/' . $this->title_to_url($forum_name) . '-f' . $forum_id . '/' . $this->title_to_url($topic_title) . '-t' . $topic_id . ($start ? '-s' . $start : '') . '.html';
        }
        return $this->path_helper->update_web_root_path($this->phpbb_root_path . $this->title_to_url($forum_name) . '-f' . $forum_id . '/' . $this->title_to_url($topic_title) . '-t' . $topic_id . ($start ? '-s' . $start : '') . '.html');
    } 
Ersetze es mit:

Code: Alles auswählen

    private function generate_topic_link($forum_id, $forum_name, $topic_id, $topic_title, $start = 0, $full = false)
    {
        if ($full)
        {
            return generate_board_url() . '/topic' . $topic_id . ($start ? '-s' . $start : '') . '.html';
        }
        return $this->path_helper->update_web_root_path($this->phpbb_root_path . 'topic' . $topic_id . ($start ? '-s' . $start : '') . '.html');
    } 

Suche:

Code: Alles auswählen

    private function generate_forum_link($forum_id, $forum_name, $start = 0, $full = false)
    {
        if ($full)
        {
            return generate_board_url() . '/' . $this->title_to_url($forum_name) . '-f' . $forum_id . '/' . ($start ? 'index-s' . $start . '.html' : '');
        }
        return $this->path_helper->update_web_root_path($this->phpbb_root_path . $this->title_to_url($forum_name) . '-f' . $forum_id . '/' . ($start ? 'index-s' . $start . '.html' : ''));
    } 
Ersetze es mit:

Code: Alles auswählen

    private function generate_forum_link($forum_id, $forum_name, $start = 0, $full = false)
    {
        if ($full)
        {
            return generate_board_url() . '/forum' . $forum_id . ($start ? '-s' . $start . '.html' : '');
        }
        return $this->path_helper->update_web_root_path($this->phpbb_root_path . 'forum' . $forum_id . ($start ? '-s' . $start . '.html' : ''));
    } 
Dann brauchst du in der .htaccess die Rewrite Regeln:

Code: Alles auswählen

RewriteRule ^topic([0-9]*)-s([0-9]*).html viewtopic.php?t=$1&start=$2&%{QUERY_STRING} [L]
RewriteRule ^topic([0-9]*).html viewtopic.php?t=$1&%{QUERY_STRING} [L]
RewriteRule ^forum([0-9]*)-s([0-9]*).html viewforum.php?f=$1&start=$2&%{QUERY_STRING} [L]
RewriteRule ^forum([0-9]*).html viewforum.php?f=$1&%{QUERY_STRING} [L]
Gruß Tobi

Edit
Rewrite Regeln korrigiert

Re: [DEV] SEO URLs

Verfasst: 19.11.2015 13:25
von darkeyeX
Ich hab die Änderungen in einem nicht wichtigen Forum ausprobiert und es klappt schonmal, danke. Auch das Löschen und Sperren von Themen funktioniert jetzt. Jedoch werden die Links unterhalb der Postings nicht umgeschrieben (Gehe zum Forum XXX, Zurück zu Hauptforum). Auch die Links in der Navileiste oberhalb der Beiträge zu den jeweiligen Forenrubriken werden auch nicht umgeschrieben. In meinen anderen phpBb Foren die mir wichtiger sind, würde ich daher diese Extension (noch) nicht installieren wollen.

Aber das ist schonmal ein Schritt in die richtige Richtung :)

Werden die oben erwähnten Links noch ungeschrieben werden können? Würde mich jedenfalls sehr freuen.

Re: [DEV] SEO URLs

Verfasst: 19.11.2015 13:55
von tas2580
Zur Zeit gibt es dafür keine Events, um die Links umzuschreiben müsste man also Dateien in phpBB selber verändern. Ob es die Events in zukünftigen Versionen einmal geben wird kann ich nicht sagen.

Gruß Tobi

Re: [DEV] SEO URLs

Verfasst: 20.11.2015 19:02
von agentc0re
Hello! I just found your ext. for phpBB and I am having a problem with it. My site for the forum is, http://agentc0re.com/Forum. The actual folder where it is stored is forum. There are some rewrite rules in place to change that. Anyways, check out how my site displays after enabling your plugin. No clue why. I've added the following rewrite rules to my .httaccess in my forum directory.

Code: Alles auswählen

## These rewrite rules are for the SEO urls ##
<IfModule mod_rewrite.c >
RewriteEngine On
RewriteBase /forum

RewriteRule ^(.*)-f([0-9]*)/(.*)-t([0-9]*)-s([0-9]*).html viewtopic.php?f=$2&t=$4&start=$5&%{QUERY_STRING} [L]
RewriteRule ^(.*)-f([0-9]*)/(.*)-t([0-9]*).html viewtopic.php?f=$2&t=$4&%{QUERY_STRING} [L]
RewriteRule global/(.*)-t([0-9]*).html ./viewtopic.php?f=1&t=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-f([0-9]*)/index-s([0-9]*).html viewforum.php?f=$2&start=$3&%{QUERY_STRING} [L]
RewriteRule ^(.*)-f([0-9]*)/ viewforum.php?f=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-f([0-9]*) viewforum.php?f=$2&%{QUERY_STRING} [L]
RewriteRule ^forum.html index.php?%{QUERY_STRING} [L]
</IfModule>
One thing that concerns me is that there is no forum.html, or maybe it's trying to rewrite that so that when index.php is access it looks like forum.html?? If that's the case, i'd not like that to happen. Would instead i changed that to 'Forum' which is my rewrite rule that points to the forums index.php?

I hope you either understand english or that the translation is good. :D

Thank you for any help you can provide!!

-Jon


UPDATE 1

OKAY im super dumb. I enabled a different plugin without looking and also added the rewrite rules. Well as you'd expect, the site didn't function without your plug. Here's the thing though, your plugin is not showing up as an ext. that i can enable. here is a image of my directory structure to show you. https://gyazo.com/0d8cdc0819701cd4a28446da81c0d42e What i've noticed that is different from your plugins and others that i have is it's missing a ext.php or some .php file in the root that i believe tells phpBB that you are indeed an ext. I hope this makes sense.

Thanks again!
-Jon

Update 2

AHHHHHHHHHHH HAH! I found out the problem. Due to the lack of my reading skills, i noticed i needed to rename the folder from the downloaded zip file from seourls-master to seourls. Now it shows up as an ext. I AM DUMB. But i hope this post helps someone else. :D

If i have further issues, i'll let you know.
-Jon

Re: [DEV] SEO URLs

Verfasst: 02.01.2016 12:40
von herpedia
Hi, kann man eigentlich auch irgendwo einstellen, wie lang die URL maximal sein soll? Ein paar Foren-URLs sind bei mir leider etwas "abgehackt", daher würde ich gerne die maximale Länge etwas erweitern...

Re: [DEV] SEO URLs .htaccess

Verfasst: 29.01.2016 16:00
von tmff
Sorry for the english! :-) I have the following .htaccess file and it has broken the seositemap.xml

I needed to change .htaccess due to SEO URLS, the URLS work but the sitemap.xml I had and the seositemap.xml do not work now.

They must be getting rewritten to something that is not valid I get 404 errors now.

RewriteEngine on
RewriteCond %{HTTP_HOST} ^nl6621.net [NC]
RewriteRule ^(.*)$ http://www.nl6621.net/$1 [L,R=301,NC]

RewriteBase /
RewriteRule ^(.*)-f([0-9]*)/(.*)-t([0-9]*)-s([0-9]*).html viewtopic.php?f=$2&t=$4&start=$5&%{QUERY_STRING} [L]
RewriteRule ^(.*)-f([0-9]*)/(.*)-t([0-9]*).html viewtopic.php?f=$2&t=$4&%{QUERY_STRING} [L]
RewriteRule global/(.*)-t([0-9]*).html ./viewtopic.php?f=1&t=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-f([0-9]*)/index-s([0-9]*).html viewforum.php?f=$2&start=$3&%{QUERY_STRING} [L]
RewriteRule ^(.*)-f([0-9]*)/ viewforum.php?f=$2&%{QUERY_STRING} [L]
RewriteRule ^(.*)-f([0-9]*) viewforum.php?f=$2&%{QUERY_STRING} [L]
RewriteRule ^forum.html index.php?%{QUERY_STRING} [L]

Re: [DEV] SEO URLs

Verfasst: 23.03.2016 12:27
von juliokr
Frage :
Gibt es irgend eine Möglichkeit die SEOurls auch in den feeds auszugeben ?
Wäre sehr hilfreich da ich die Themen auf meinem Form als RSS feed auf anderen Seiten ausgebe

Re: [DEV] SEO URLs

Verfasst: 31.03.2016 17:23
von lddd
Kann Jemand eine funktionierende Nginx Config posten? Ich habe nun verschiedenes ausprobiert aber nichts funktioniert. Ich nutze phpBB 3.1.8. Danke für eure Hilfe.

Re: [DEV] SEO URLs

Verfasst: 04.04.2016 01:20
von tas2580
Nach den feeds schaue ich naechste Woche mal. Rewrite fuer nginx gibt es hier: https://github.com/tas2580/seourls/blob ... ewrite.txt