Web based family history software

If you need to upgrade your PGV installation, then hopefully you will also consider that you can conveniently move to webtrees with our PGV-to-webtrees wizard. It will move ALL your users, news, favorites and family trees to webtrees in a matter of minutes.

Solved How can I make the 301 redirect rule take effect

  • xmlf
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 years 8 months ago #1 by xmlf
I have switched from phpgedview to webtrees. The URL structure of webtrees and phpgedview is different.
I want to use the Rewrite rule for 301 redirects. I configured the redirect rule in nginx, but it doesn't work.
I checked that the default setting for webtrees is that it can still be accessed using the old URL of phpgedview.
This can result in a lot of duplicate content appearing on two different URLs. This is very unfriendly to search engines.
How can I make the 301 redirect rule take effect?

Wang Family Website of Suining County, China
www.snwsjz.com
A family tree website that is customized, more humanized and convenient for users.

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

  • fisharebest
  • Away
  • Administrator
  • Administrator
More
5 years 8 months ago #2 by fisharebest
Replied by fisharebest on topic How can I make the 301 redirect rule take effect
> I configured the redirect rule in nginx

Can you share the nginx configuration?

> but it doesn't work.

What happened? Give an example?

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

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

  • xmlf
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 years 8 months ago #3 by xmlf
Nginx rule:
rewrite ^/individual.php?pid=(.*)&ged=(.*) /index.php?route=individual&xref=$1&ged=$2 permanent;

Example:
www.zisun.org/individual.php?pid=X333&ged=ke
And
www.zisun.org/index.php?route=individual&xref=X333&ged=ke

Both can access the same content. And the return http status code is 200.

Wang Family Website of Suining County, China
www.snwsjz.com
A family tree website that is customized, more humanized and convenient for users.

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

  • fisharebest
  • Away
  • Administrator
  • Administrator
More
5 years 8 months ago #4 by fisharebest
Replied by fisharebest on topic How can I make the 301 redirect rule take effect
Perhaps this rule is applied *after* your existing rules.

Since there is already a file individual.php in webtrees, this one is used.

I guess the file in webtrees should be updated to return a 301. Raise a ticket on github.

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

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

  • xmlf
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 years 7 months ago #5 by xmlf
Is my nginx rule configuration error.
In the nginx rewrite rule, the "?" processing method is different.
However, the old URL can still be browsed by default, which is still very unfriendly to search engines.

Wang Family Website of Suining County, China
www.snwsjz.com
A family tree website that is customized, more humanized and convenient for users.

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

  • xmlf
  • Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 years 7 months ago #6 by xmlf
Problem solved.

Wang Family Website of Suining County, China
www.snwsjz.com
A family tree website that is customized, more humanized and convenient for users.

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

Powered by Kunena Forum