This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

k.van.rossum12000
k.van.rossum12000

Hello guys,

I would like to make multiple urls link to a single page.

example:

  • patern: /organization
  • patern: /team

both link to the file: organization.htm

I want to do this so i can translate pages and the url for better SEO.

I thought about editing the rainrouter but won't my changes be overwritten in an october update? Does anybody know of a way to do this?

Thanks in advance :)

Last updated

Asinox
Asinox

I think you will try a dynamic URL, like / ^(organization|team)$/

k.van.rossum12000
k.van.rossum12000

I thought about a regeluar expression, but october prevents me from using parentheses in the url.

Or do you mean that I should declare the url somewhere else?

Asinox
Asinox

Maybe you can use .htaccess


RewriteEngine On
RewriteRule ^organization.htm/(organization | team) http://domain.com/organization.htm [R=301]
Stranger Pings
Stranger Pings

For SEO, don't forget to add the canonical link tag to the page so search engines don't index duplicate content.

See : https://yoast.com/rel-canonical/

k.van.rossum12000
k.van.rossum12000

Content is going to be translated in each language with the translate plugin. So search engines won't be indexing duplicate content.

Our servers are running a NGINX stack, so creating the rewrite rules everytime a page is added won't be very convenient.

I feel the regex route in the url could be an option, and I'm going to experiment with that today!

k.van.rossum12000
k.van.rossum12000

Still struggling with this one.

Anybody have any ideas?

the-foreigner
the-foreigner

Hi did you solve the problem?

jan-vince
jan-vince

As in Docs, regex is probably possible only with parameters.

This worked for me:
/:param|^\btest1\b|\btest2\b$

This will match /test1 and /test2 and open same October page.

codacopia
codacopia

This is an old thread, but the @jan-vince answer worked for me. Thx.

1-10 of 10

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.