[Solved] New URLs and absolute/relative links

The place for discussions and decisions about the forum

[Solved] New URLs and absolute/relative links

Postby RGB » Wed Aug 15, 2012 5:41 pm

There is an unexpected draw back with the new URLs: if you log on the new URL and click on a link to another post that was written using the old address you'll go to that old address... and will be logged out.

While this redirection problem is solved (I reported it on the dev mailing lists yesterday) there is one thing we can do to alleviate it: use relative URLs to cross reference posts.

The problem is that phpBB do not offer relative links by default, but this feature is easy to implement as a custom tag. I followed this post and added the relative URL tags on the ES forums: they work perfectly.

Of course this will not solve the problem of existing links, this can only be solved by a proper redirect, but I think it is a good idea to always use relative links on the forum from now on. What do you think?

Regards
Last edited by RGB on Wed Aug 15, 2012 7:03 pm, edited 1 time in total.
There are two types of people: those who believe that there are two types of people and those who do not.

openSUSE Leap with KDE Plasma / LibO
User avatar
RGB
 
Posts: 1454
Joined: Mon Oct 08, 2007 1:34 am

Re: New URLs and absolute/relative links

Postby Hagar Delest » Wed Aug 15, 2012 6:30 pm

Sounds good, it would spare some work in the future I guess.

I've added the tag (appear on the right of the BBCodes top of the message area.
Is it the correct string?
Code: Select all   Expand viewCollapse view
[rel=viewtopic.php?f=102&t=55691]link to the post above[/rel]

link to the post above seems to work fine.
AOO 4.1.6 on Xubuntu 19.04 and 4.1.5 on Windows 7 (with winPenPack port).
User avatar
Hagar Delest
Moderator
 
Posts: 28543
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: New URLs and absolute/relative links

Postby RGB » Wed Aug 15, 2012 7:04 pm

Hagar Delest wrote:Is it the correct string?


At least it is the same string I used on the ES forum ;)
There are two types of people: those who believe that there are two types of people and those who do not.

openSUSE Leap with KDE Plasma / LibO
User avatar
RGB
 
Posts: 1454
Joined: Mon Oct 08, 2007 1:34 am

Re: [Solved] New URLs and absolute/relative links

Postby TerryE » Tue Aug 21, 2012 1:54 pm

RGB wrote:Of course this will not solve the problem of existing links

This substitution is pretty straight forward for someone who has command line access to the MySQL database. Perhaps Imacat can do this for you.
Ubuntu 11.04-x64 + LibreOffice 3 and MS free except the boss's Notebook which runs XP + OOo 3.3.
TerryE
Volunteer
 
Posts: 1402
Joined: Sat Oct 06, 2007 10:13 pm
Location: UK

Re: [Solved] New URLs and absolute/relative links

Postby RGB » Tue Aug 21, 2012 11:09 pm

Hy, Terry! Nice to read you again.

I think there are two situations, one straightforward, the other not so.

The straightforward situation is a properly formatted url tag used to cross reference another thread: in this situation, changing url=http://....../viewtopic..... with rel=viewtopic...... and the corresponding /url with a /rel is enough. But the problem is that most people do not format the urls, they just copy paste them. To change a simple

Code: Select all   Expand viewCollapse view
http://forum.openoffice.org/en/forum/viewforum.php?f=76

to a relative address several changes needs to be done. Maybe if a "lone url" is found, then use the "viewtopic...." as link text:

Code: Select all   Expand viewCollapse view
[rel=viewforum.php?f=76]viewforum.php?f=76[/url]

Some regexp magic is needed.

Also, AFAIK the rel tag is only used here and on the ES forum.
There are two types of people: those who believe that there are two types of people and those who do not.

openSUSE Leap with KDE Plasma / LibO
User avatar
RGB
 
Posts: 1454
Joined: Mon Oct 08, 2007 1:34 am

Re: [Solved] New URLs and absolute/relative links

Postby TerryE » Thu Aug 23, 2012 5:22 pm

Yup, but unfortunately the regexp support in MySQL is limited to matching only rather than substitution, so you can't do this with a simple MySQL statement. You need to write a small batch script which does a select, mangle, update on the post table for all posts containing 'http://forum.openoffice.org/../forum/'. One for Imacat, sorry.
Ubuntu 11.04-x64 + LibreOffice 3 and MS free except the boss's Notebook which runs XP + OOo 3.3.
TerryE
Volunteer
 
Posts: 1402
Joined: Sat Oct 06, 2007 10:13 pm
Location: UK

Re: [Solved] New URLs and absolute/relative links

Postby kingfisher » Fri Aug 24, 2012 2:06 am

I don't know why this has been marked as solved. I have reverted to the old url because the new one requires me to log in every time I use it.
Apache OpenOffice 4.1.6 on PCLinuxOS
User avatar
kingfisher
Volunteer
 
Posts: 2120
Joined: Tue Nov 20, 2007 10:53 am

Re: [Solved] New URLs and absolute/relative links

Postby floris v » Fri Aug 24, 2012 8:05 am

Same for me.
AOO 4.1.6 op Linux Mint
If your problem has been solved or your question has been answered, please edit the first post in this thread and add [Solved] to the title bar.
Nederlandstalig forum
User avatar
floris v
Moderator
 
Posts: 4138
Joined: Wed Nov 28, 2007 1:21 pm
Location: Netherlands

Re: [Solved] New URLs and absolute/relative links

Postby RGB » Fri Aug 24, 2012 9:34 pm

kingfisher wrote:I don't know why this has been marked as solved. I have reverted to the old url because the new one requires me to log in every time I use it.

The thread was about introducing the "relative link tag", which is now working.
There are two types of people: those who believe that there are two types of people and those who do not.

openSUSE Leap with KDE Plasma / LibO
User avatar
RGB
 
Posts: 1454
Joined: Mon Oct 08, 2007 1:34 am

Re: [Solved] New URLs and absolute/relative links

Postby kingfisher » Sat Aug 25, 2012 4:03 am

OK. Thanks. I'll continue using the old urls. It's a real pest when I get an email containing a link using the new path.
Apache OpenOffice 4.1.6 on PCLinuxOS
User avatar
kingfisher
Volunteer
 
Posts: 2120
Joined: Tue Nov 20, 2007 10:53 am


Return to Forum Governance

Who is online

Users browsing this forum: No registered users and 0 guests