If somebody over here has some regex skills and wants to write the expression, i'll take it
My regex fu is near zero atm, so i know it will take me lots of trial and error...
Regards,
Erwan
Posted 16 March 2021 - 07:56 PM
If somebody over here has some regex skills and wants to write the expression, i'll take it
My regex fu is near zero atm, so i know it will take me lots of trial and error...
Regards,
Erwan
Posted 17 March 2021 - 08:57 AM
If somebody over here has some regex skills and wants to write the expression, i'll take it
My regex fu is near zero atm, so i know it will take me lots of trial and error...
Regards,
Erwan
Hi Erwan
how are the "expressions" written? In a txt file or database?
I'd like to help. T.
Posted 17 March 2021 - 12:02 PM
Think this is the search expression:
^.*/topic/([0-9]*).*#entry([0-9]*)$
This is the replace expression:
http://reboot.pro/index.php?showtopic=\1&view=findpost&p=\2
Posted 17 March 2021 - 01:40 PM
Think this is the search expression:
^.*/topic/([0-9]*).*#entry([0-9]*)$This is the replace expression:
http://reboot.pro/index.php?showtopic=\1&view=findpost&p=\2
For the Downloads Links we need something else e.g. BootIce v1.3.3.3.2
http://reboot.pro/files/file/592-bootice-v1332/
must be replaced by
http://reboot.pro/index.php?app=downloads&showfile=592
=
Does not occur so often, but Subforum Boot from USB / Boot anywhere
http://reboot.pro/forum/71/
must be replaced by
http://reboot.pro/index.php?showforum=71
=
Posted 17 March 2021 - 08:10 PM
Think this is the search expression:
^.*/topic/([0-9]*).*#entry([0-9]*)$This is the replace expression:
http://reboot.pro/index.php?showtopic=\1&view=findpost&p=\2
if i use https://regexr.com/ to test with :
-test string : hxxp://reboot.pro/topic/21977-vhd-wimboot-apply-and-capture-of-wim-files-for-os-in-vhd/page-14#entry216443
-expression = ^.*/topic/([0-9]*).*#entry([0-9]*)$
-substitution = hxxp://reboot.pro/index.php?showtopic=$1&view=findpost&p=$2
i get as a result : hxxp://reboot.pro/index.php?showtopic=21977&view=findpost&p=216443
which looks good !
so now i need to start testing apache and rewrite mod.
Posted 18 March 2021 - 06:01 PM
ok, almost there...
first apache rewriterule works (so I know the rewrite mod is effective).
but not the second one.
any idea?
will continue testing.
<Directory /var/www/reboot.pro> RewriteEngine On # RewriteRule ^toto\.html /titi.html [R=301,L] RewriteRule ^.*/topic/([0-9]*).*#entry([0-9]*)$ /index.php?showtopic=$1&view=findpost&p=$2 [R=301,L] </Directory>
Posted 18 March 2021 - 06:07 PM
Not sure if it solves the issue but &view=findpost can (should) be omitted
Working Link is e.g.
http://reboot.pro/index.php?showtopic=21977&p=216443
You are using $1 and $2 whereas paraglider is using \1 and \2 as parameter
Posted 18 March 2021 - 07:36 PM
Not sure if it solves the issue but &view=findpost can (should) be omitted
Working Link is e.g.
http://reboot.pro/index.php?showtopic=21977&p=216443You are using $1 and $2 whereas paraglider is using \1 and \2 as parameter
If i use https://regexr.com/ or read the doc (here) it seems that I should be using $1 not /1.
For now it seems the match is not working : it should trigger a redirect to "something" but it does not.
From the apache doc (ignore the first two lines) :
In this example, a request for /test/1234 would be transformed into /admin.foo?page=test&id=1234&host=admin.example.com
Posted 18 March 2021 - 11:48 PM
The think the start of the search is at /topic i.e it does not include the http:/reboot.pro so search string should be:
^/topic/([0-9]*).*#entry([0-9]*)$
Posted 19 March 2021 - 07:25 AM
First up, until today I had no clue about Apache configurations, but as I thought to know enough about regular expressions, my interest was piqued. So, after reading a bit about RewriteRules I went on a search, and found an online tester.
As a result, I'd like to suggest to give it a try with the following rule:
RewriteRule ^topic/(\d+).*/page-(\d+)$ index.php?showtopic=$1&page=$2
I better make a few more comments:
Now, the last point means of course, that the intended rule (i.e. "converting" the "entry number" into a "post number") might not "fly". But I'd like to think that the combination of topicID, and pageID (plus the unchanged URI fragment, that the browser should add) might do the trick.
Furthermore, I'd imagine a few more rules are required to deal with the cases like:
hxxp://reboot.pro/topic/21977-vhd-wimboot-apply-and-capture-of-wim-files-for-os-in-vhd
and (my personal favorite):
hxxp://reboot.pro/topic/21977/
I'd imagine that the following rules could do the trick:
RewriteRule ^topic/(\d+).*$ index.php?showtopic=$1 RewriteRule ^topic/(\d+)/$ index.php?showtopic=$1
PS (1): May I suggest an additional "friendly name", which I don't recall, whether it ever existed in the past:
RewriteRule ^topic/(\d+)/(\d+)/$ index.php?showtopic=$1&page=$2
(I can't make up my mind, whether I like it better with, or without the trailing slash)
PS (2): My thanks to Erwan, who opened up this issue to an "free for all" (and provided enough background clues). One of my reasons to visit 'reboot.pro' is to find little inspirations to learn something new. So, thanks again for today's contribution to that "quest".
Posted 19 March 2021 - 08:40 PM
Guys,
Based on Maro's suggestion, i implemented the below which seems to work :
RewriteRule ^topic/(\d+).*$ index.php?showtopic=$1 RewriteRule ^topic/(\d+)/$ index.php?showtopic=$1
Try this link (or any other friendly url you may have) and let me know how it works for you : http://reboot.pro/topic/21977-vhd-wimboot-apply-and-capture-of-wim-files-for-os-in-vhd/page-14#entry216443 .
And thanks to paraglider and maro to put me/us on the right track
Regards,
Erwan
Posted 19 March 2021 - 11:06 PM
Thanks to erwan.l, paraglider and maro
I can confirm the implementation of the RewriteRules quoted in previous post are working very fine.
Tested with the link in previous post and from it opening the link to the new topic mentioned in that post, and also from that topic opening all links mentioned on it.
Now all friendly URL internal links are working fine again.
alacran
Posted 20 March 2021 - 12:20 AM
Also I can confirm now the friendly URL link embedded into Wimlib-clc program made by our fellow retokener, also opens again the topic related to Wimlib-clc on reboot.pro
alacran
Posted 20 March 2021 - 01:29 AM
Thanks to erwan.l, paraglider and maro
I can confirm the implementation of the RewriteRules quoted in previous post are working very fine.
Tested with the link in previous post and from it opening the link to the new topic mentioned in that post, and also from that topic opening all links mentioned on it.
Now all friendly URL internal links are working fine again.
alacran
But also the standard URL links are working fine.
So this means both are valid:
Sample:
Friendly URL: http://reboot.pro/topic/22383-reducing-win10-and-older-oss-footprint/ or standard URL: http://reboot.pro/index.php?showtopic=22383
Also testing a little further I confirmed new links to post are created using standard URL (wich IMHO is the best way, as it is the standard protocol used in all the web).
Sample editing first post on this topic: http://reboot.pro/in...showtopic=22383
Where the first is an old created (2020-11-06) Friendly URL and the second (Bold) is a new created (2021-03-19) standard URL.
Wich are respectively links to:
http://reboot.pro/topic/22383-reducing-win10-and-older-oss-footprint/page-14#entry216974 and http://reboot.pro/index.php?showtopic=22383&page=18#entry217901
alacran
Posted 20 March 2021 - 07:25 AM
Thanks to erwan.l, paraglider and maro
All friendly URL's to topic posts are working fine now,
but Links for Downloads files still FAIL
Try e.g. to download BootIce using http://reboot.pro/fi...-bootice-v1332/
Also Link to Subforum like Boot from USB / Boot anywhere is a problem e.g. try http://reboot.pro/forum/71/
For the Downloads Links we need something else e.g. BootIce v1.3.3.3.2
http://reboot.pro/files/file/592-bootice-v1332/must be replaced by
http://reboot.pro/index.php?app=downloads&showfile=592=
Does not occur so often, but Subforum Boot from USB / Boot anywhere
http://reboot.pro/forum/71/must be replaced by
http://reboot.pro/index.php?showforum=71
Posted 20 March 2021 - 11:46 AM
Tiny url's like http://reboot.pro/forum/71/ should now work.
I am not managing it for now for the files url's.
Also I dont get why the url does not get rewritten (in the url bar) for forum url's when it does for topics url's?
Current conf.
<Directory /var/www/reboot.pro> RewriteEngine On RewriteRule ^topic/(\d+).*$ index.php?showtopic=$1 RewriteRule ^topic/(\d+)/$ index.php?showtopic=$1 RewriteRule ^forum/(\d+)/$ index.php?showforum=$1 RewriteRule ^files/file/(\d+)/$ index.php?app=download&showfile=$1 </Directory>
Posted 20 March 2021 - 03:04 PM
Tiny url's like http://reboot.pro/forum/71/ should now work.
I am not managing it for now for the files url's.
Also I dont get why the url does not get rewritten (in the url bar) for forum url's when it does for topics url's?
Current conf.
<Directory /var/www/reboot.pro> RewriteEngine On RewriteRule ^topic/(\d+).*$ index.php?showtopic=$1 RewriteRule ^topic/(\d+)/$ index.php?showtopic=$1 RewriteRule ^forum/(\d+)/$ index.php?showforum=$1 RewriteRule ^files/file/(\d+)/$ index.php?app=download&showfile=$1 </Directory>
forum link is working OK
files RewriteRule should have downloads instead of download (the s is missing ....)
Posted 20 March 2021 - 04:27 PM
forum link is working OK
files RewriteRule should have downloads instead of download (the s is missing ....)
Good catch!
Still no luck thus : match is not working for now.
I'll try differents combinations.
<Directory /var/www/reboot.pro> RewriteEngine On RewriteRule ^topic/(\d+).*$ index.php?showtopic=$1 RewriteRule ^topic/(\d+)/$ index.php?showtopic=$1 RewriteRule ^forum/(\d+)/$ index.php?showforum=$1 RewriteRule ^files/file/(\d+)/$ index.php?app=downloads&showfile=$1 </Directory>
Posted 20 March 2021 - 04:34 PM
Everything should be OK now.
Tiny url's for topics, forums and downloads.
This online tester was a great help (thanks Maro).
<Directory /var/www/reboot.pro> RewriteEngine On RewriteRule ^topic/(\d+).*$ index.php?showtopic=$1 RewriteRule ^topic/(\d+)/$ index.php?showtopic=$1 RewriteRule ^forum/(\d+)/$ index.php?showforum=$1 RewriteRule ^files/file/(\d+).*/$ index.php?app=downloads&showfile=$1 </Directory>
Posted 20 March 2021 - 04:38 PM
Everything should be OK now.
Tiny url's for topics, forums and downloads.
This online tester was a great help (thanks Maro).
<Directory /var/www/reboot.pro> RewriteEngine On RewriteRule ^topic/(\d+).*$ index.php?showtopic=$1 RewriteRule ^topic/(\d+)/$ index.php?showtopic=$1 RewriteRule ^forum/(\d+)/$ index.php?showforum=$1 RewriteRule ^files/file/(\d+).*/$ index.php?app=downloads&showfile=$1 </Directory>
Everything OK now.
Thanks to erwan.l, paraglider and maro
Posted 20 March 2021 - 07:02 PM
POPULAR
For the record, please note that FURL is not enabled at the forum software level (aka "use_friendly_urls" parameter).
What we are doing here is using the apache rewriteurl feature to catch old friendly url's and to rewrite them on the fly.
This in order to support the old posts on this forum using FURL.
Posted 22 March 2021 - 05:28 PM
Wich are respectively links to:
http://reboot.pro/topic/22383-reducing-win10-and-older-oss-footprint/page-14#entry216974 and http://reboot.pro/index.php?showtopic=22383&page=18#entry217901alacran
Only FYI, the last one is "mixed mode", even if works the "canonical" link is (as currently generated by the board):
hxxp://reboot.pro/index.php?showtopic=22383&p=217901
As a side note, and just for the record the (good ol') syntax to get to posts by their offset in the thread was lost in one of the past updates of server or software.
I.e. your quoted post, which is #66 in the thread USED to be easily linkable, without knowing that it is post #217901 on the whole board by using the syntax:
hxxp://reboot.pro/index.php?showtopic=22430&st=65
i.e. &st=(post # - 1)
that currently (but since several years) resolves to the first post on a page it USED to be (rounded) page # divided by the number of set posts per page, i.e. 65/25= 2.6 -> 3 and this is not even fixed-fixed as sometimes in the past the board posts per page was changed from 20 to 25, and - for some time - one could use fractional page numbers (like 3.2) to get to a given post, but right now it is *random*, i.e.:
hxxp://reboot.pro/index.php?showtopic=22430&st=0
is fine but
hxxp://reboot.pro/index.php?showtopic=22430&st=1
goes to second page, as well as up to
hxxp://reboot.pro/index.php?showtopic=22430&st=25
BUT
hxxp://reboot.pro/index.php?showtopic=22430&st=26
goes to third page ...
... madness ...
Wonko
0 members, 2 guests, 0 anonymous users