Before asking for help please read "Requesting Help and Suggestions" by clicking on that tab above here.
  • Page:
  • 1

TOPIC:

url problems 4 weeks 1 day ago #1

  • geme
  • geme's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 38
I only have one family tree (GEDCOM).

On version 1.7 I was able to call up a person with the following URL: "https://'Domain'/individual.php?pid='ID'"

Under version 2.1 I get the message "The parameter “ged” is missing".

There are many external websites and emails that use these links. So I switched version 2.1 to 'pretty urls'.
Can any one help me?

Example 1.7 (sorry, only in German): f.helmsheim.me/individual.php?pid=I3646

Please Log in or Create an account to join the conversation.

Last edit: by geme.

url problems 4 weeks 1 day ago #2

  • Franz Frese
  • Franz Frese's Avatar
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 363

Please Log in or Create an account to join the conversation.

url problems 4 weeks 1 day ago #3

  • geme
  • geme's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 38
Thanks for the hint. However, the existing links without "tree" should work.

freris.de/tree/frese/individual/XI2

I have only one gedcom (tree).

Please Log in or Create an account to join the conversation.

url problems 4 weeks 20 hours ago #4

  • bertkoor
  • bertkoor's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Greetings from Utrecht, Holland
  • Posts: 2743
This was (shortly) discussed some months ago:
www.webtrees.net/index.php/en/forum/help...ut-pretty-urls#90002

But please do note this, from the documentation it seems you don't need to do anything:

webtrees FAQ wrote: Recognising URLs from webtrees 1.x and phpGedView

webtrees is able to recognise the URLs generated by these older applications. So bookmarks and search engine links to {base_url}/individual.php?pid=XXX&ged=YYY will be automatically forwarded to {base_url}/tree/YYY/individual/XXX.

Note that this will not work for relative URLs that you may have embedded in HTML blocks on your home pages. e.g. <a href="individual.php">...</a>. You will need to edit these manually.


I have not tested it, but parameter "ged" should be optional, and when absent take the first public tree. That was the behaviour in webtrees 1.7.
If that doesn't work, then an issue needs to be reported to the issue tracker on GitHub: github.com/fisharebest/webtrees/issues
stamboom.BertKoor.nl runs on webtrees v1.7.13

Please Log in or Create an account to join the conversation.

Last edit: by bertkoor.

url problems 4 weeks 16 hours ago #5

  • ddrury
  • ddrury's Avatar
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 346
Ensure the Legacy URLs module is enabled
--
Dave

Local: Win 10 Pro, Apache 2.4.41, PHP 7.4.20/8.0.1, MySQL 8.0.26
Production: Litespeed 7.9, PHP 8.0.10, MySQL 8.0.26

Please Log in or Create an account to join the conversation.

url problems 4 weeks 15 hours ago #6

  • geme
  • geme's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 38
bertkoor wrote:
Parameter "ged" should be optional, and when absent take the first public tree. That was the behaviour in webtrees 1.7.

In your family tree (1.7) it also works
example without tree : stamboom.bertkoor.nl/individual.php?pid=I287

With version 2.1 it will no longer work!

ddrury the Legacy URLs works fine.

Please Log in or Create an account to join the conversation.

url problems 3 weeks 5 days ago #7

  • geme
  • geme's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 38
webtrees should change the class : "RedirectIndividualPhp".

<snip>

<?php

/**
* webtrees: online genealogy
* Copyright (C) 2022 webtrees development team
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <www.gnu.org/licenses/>.
*/

declare(strict_types=1);

namespace Fisharebest\Webtrees\Http\RequestHandlers;

use Fig\Http\Message\StatusCodeInterface;
use Fisharebest\Webtrees\Http\Exceptions\HttpNotFoundException;
use Fisharebest\Webtrees\I18N;
use Fisharebest\Webtrees\Individual;
use Fisharebest\Webtrees\Registry;
use Fisharebest\Webtrees\Services\TreeService;
use Fisharebest\Webtrees\Tree;
use Fisharebest\Webtrees\Validator;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;

/**
* Redirect URLs created by webtrees 1.x (and PhpGedView).
*/
class RedirectIndividualPhp implements RequestHandlerInterface
{
private TreeService $tree_service;

/**
* @param TreeService $tree_service
*/
public function __construct(TreeService $tree_service)
{
$this->tree_service = $tree_service;
}

/**
* @param ServerRequestInterface $request
*
* @return ResponseInterface
* @throws HttpNotFoundException
*/
public function handle(ServerRequestInterface $request): ResponseInterface
{
//geme $ged = Validator::queryParams($request)->string('ged');
$ged = $request->getAttribute('ged'); //geme
$pid = Validator::queryParams($request)->isXref()->string('pid');
$tree = $this->tree_service->all()->get($ged) ?? $this->tree_service->all()->first(); //geme
if ($tree instanceof Tree) {
$individual = Registry::individualFactory()->make($pid, $tree);

if ($individual instanceof Individual) {
return Registry::responseFactory()->redirectUrl($individual->url(), StatusCodeInterface::STATUS_MOVED_PERMANENTLY);
}
}

$message = I18N::translate('This individual does not exist or you do not have permission to view it.');

throw new HttpNotFoundException($message);
}
}

Please Log in or Create an account to join the conversation.

Last edit: by geme.

url problems 3 weeks 4 days ago #8

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 16208
Maybe this worked in webtrees 1.7.

But I don't think it was part of the design.

webtrees always created URLs with the "ged" parameter.

Create an issue on github.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

Do you need a web hosting solution for your webtrees site?
If you prefer a host that specialises in webtrees, the following page lists some suppliers able to provide one for you: 
  • Page:
  • 1
Powered by Kunena Forum