modify url rewriting

Changes the URLs of forums and topics too more SEO friendly URLs with the title of the forums and topics in it. This extension is held as simple as possible, it contains no ACP, you can just install it and use the SEO friendly URLs.
Post Reply
remi31620
Benutzer
Benutzer
Posts: 4
Joined: 22. Aug 2016 22:26
phpBB Version: 2.0

modify url rewriting

Post by remi31620 » 22. Aug 2016 22:43

hello,

first thank for all your work.

I'm using your extension php seo url and all is perfect but i'm would like to modify topic url for example :

actually is
mywebsite.com/forum/forum_category_title/topic_title.html and i would like
mywebsite.com/forum/topic_title.html

could you explain me what's file i must modify ?
Thanks

User avatar
tas2580
Site Admin
Site Admin
Posts: 92
Joined: 30. Apr 2016 23:29
Location: /home/tas2580
phpBB Version: 3.2
Contact:

Re: modify url rewriting

Post by tas2580 » 23. Aug 2016 01:26

Hi,

look at here and here.

remi31620
Benutzer
Benutzer
Posts: 4
Joined: 22. Aug 2016 22:26
phpBB Version: 2.0

Re: modify url rewriting

Post by remi31620 » 27. Aug 2016 13:07

hi,
thanks for your answer.
i saw your anwser and links, but doesn't work :(

User avatar
tas2580
Site Admin
Site Admin
Posts: 92
Joined: 30. Apr 2016 23:29
Location: /home/tas2580
phpBB Version: 3.2
Contact:

Re: modify url rewriting

Post by tas2580 » 27. Aug 2016 14:27

Hi,

what does not work?

Replace in seourls/event/base.php

Code: Select all

		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->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';
with

Code: Select all

		if ($full)
		{
			return generate_board_url() . '/' . $this->title_to_url($topic_title) . '-t' . $topic_id . ($start ? '-s' . $start : '') . '.html';
		}
		return $this->phpbb_root_path . $this->title_to_url($topic_title) . '-t' . $topic_id . ($start ? '-s' . $start : '') . '.html';
Also you have to replace in your .htaccess

Code: Select all

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]
with

Code: Select all

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

remi31620
Benutzer
Benutzer
Posts: 4
Joined: 22. Aug 2016 22:26
phpBB Version: 2.0

Re: modify url rewriting

Post by remi31620 » 27. Aug 2016 16:09

I did all you write, but i have " no suject found for this URL"

Example : http://vivre-la-martinique.fr/forum/ven ... -t966.html

User avatar
tas2580
Site Admin
Site Admin
Posts: 92
Joined: 30. Apr 2016 23:29
Location: /home/tas2580
phpBB Version: 3.2
Contact:

Re: modify url rewriting

Post by tas2580 » 27. Aug 2016 16:40

Have you set

Code: Select all

RewriteBase /forum/
in htaccess?

remi31620
Benutzer
Benutzer
Posts: 4
Joined: 22. Aug 2016 22:26
phpBB Version: 2.0

Re: modify url rewriting

Post by remi31620 » 27. Aug 2016 16:44

Yes :

Code: Select all

RewriteEngine on
RewriteBase /forum/
RewriteRule ^(.*)-t([0-9]*)-s([0-9]*).html viewtopic.php?f=0&t=$2&start=$3&%{QUERY_STRING} [L]
RewriteRule ^(.*)-t([0-9]*).html viewtopic.php?f=0&t=$1&%{QUERY_STRING} [L]
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 ^(.*)-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]

Post Reply

Social Media

       

Who is online

Users browsing this forum: No registered users and 1 guest