Management of redarection URL on the forum(viewtopics, viewforum)

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Post Reply
Ornella@
Registered User
Posts: 3
Joined: Mon Jul 12, 2021 7:38 am

Management of redarection URL on the forum(viewtopics, viewforum)

Post by Ornella@ »

This is my first time to use phpbb, I have installed phpbb. I use phpstorm as a development tool and I develop in php. I do not know in which file of my project that I will make the changes to manage the urls of my forum. Especially with the changes that there are with the new version of php.
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53379
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Management of redarection URL on the forum(viewtopics, viewforum)

Post by Brf »

Why would you need to manage the URLs of your phpBB board?
Ornella@
Registered User
Posts: 3
Joined: Mon Jul 12, 2021 7:38 am

Re: Management of redarection URL on the forum(viewtopics, viewforum)

Post by Ornella@ »

Because, I am working on a project that was given to me. The goal is to create a new forum which is the same as the old one, but with the new version of php version 7.3. Using phpbb3 Both forums (old and new) must use the same server. Because the new version of phpbb will have new features especially at the URL level. Currently, I have access to the old forum and I have its source code, but the new forum, I don't know how to redirect url
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53379
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Management of redarection URL on the forum(viewtopics, viewforum)

Post by Brf »

You are going to have to give an example. There should be no need for you to worry about URLs.
User avatar
warmweer
Jr. Extension Validator
Posts: 11197
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium
Contact:

Re: Management of redarection URL on the forum(viewtopics, viewforum)

Post by warmweer »

Ornella@ wrote: Thu Jul 15, 2021 2:18 pm Because, I am working on a project that was given to me. The goal is to create a new forum which is the same as the old one, but with the new version of php version 7.3. Using phpbb3 Both forums (old and new) must use the same server. Because the new version of phpbb will have new features especially at the URL level. Currently, I have access to the old forum and I have its source code, but the new forum, I don't know how to redirect url
Your statement "create a new forum which is the same as the old one but with the new version of php" raises some questions.
The first question which comes to mind is: which phpBB version is the old one?
The second question is: what do you mean with "the same"?

The third "issue" really baffles me: new features at the url level? what does that mean?

I suspect that what you really want to do is to upgrade the old board to the latest version and not use both boards at the same time (which is possible but not using the same database data).
Please explain what the end result of your action should be because if I am correct that you just want to continue using the board but upgrade the version, then that can be done easily.
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.


Time flies like an arrow, but fruit flies like a banana.
Ornella@
Registered User
Posts: 3
Joined: Mon Jul 12, 2021 7:38 am

Re: Management of redarection URL on the forum(viewtopics, viewforum)

Post by Ornella@ »

Hello everyone,
Am sorry for the delay. I think let you in to confusion and i am sorry.I want to migrate a phpbb2.x forum on which a mod url rewriting has been installed, to phpbb3.x and therefore, keep the same url system for referencing reasons, without go through redirects.
these are some content from the .htaccess of the old forum which corresponds to the urls that we want to rework:


RewriteRule ^. * - f ([0-9] +) - ([0-9] +) \. Html $ viewforum.php? F = $ 1 & start = $ 2 [QSA, L]
# FORUM
RewriteRule ^. * - f ([0-9] +) \. Html $ viewforum.php? F = $ 1 [QSA, L]
# PAGINATED TOPIC
RewriteRule ^. * - t ([0-9] +) - ([0-9] +) \. Html $ viewtopic.php? T = $ 1 & start = $ 2 [QSA, L]
# TOPIC
RewriteRule ^. * - t ([0-9] +) \. Html $ viewtopic.php? T = $ 1 [QSA, L]
# POST
RewriteRule ^ post ([0-9] +) \. Html $ viewtopic.php? P = $ 1 [QSA, L]

From what I see, the urls are almost identical BEFORE applying the URL rewriting between the two forums which therefore simplifies the problem.
So i have to localize what makes it possible to generate URLs, because I think that all of this is quite localized, in a single file.
i don't know if there is a function that allows this. Once located, i think i just have to modify this function so that instead of generating something like this (for example):

viewforum.php? f = XXXXX & start = XXXX gives montopicquivabien-f554521-2.html.
User avatar
AmigoJack
Registered User
Posts: 6106
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Management of redarection URL on the forum(viewtopics, viewforum)

Post by AmigoJack »

Ornella@ wrote: Fri Jul 16, 2021 7:51 amI think that all of this is quite localized, in a single file
No: links aren't generated in one single way, and they aren't generated in one single function. If you would have just looked at \viewtopic.php you would have noticed {$phpbb_root_path}viewtopic.$phpEx appears a lot and you'd have a hard time turning all those into "pretty" URLS with texts in it.

Furthermore: isn't that a circular loop? You want to turn viewtopic.php?f=641&t=2597591 into management-of-redarection-url-on-the-forums-t2597591.html, which then is recognized by the Rewrite module thru .htaccess to turn it back into the former form?
  • "The problem is probably not my English but you do not want to understand correctly. ... We will not come anybody anyway, nevertheless, it's best to shit this." Affin, 2018-11-20
  • "But this shit is not here for you. You can follow with your. Maybe the question, instead, was for you, who know, so you shoved us how you are." axe70, 2020-10-10
  • "My reaction is not to everyone, especially to you." Raptiye, 2021-02-28
Post Reply

Return to “phpBB Custom Coding”