Kentico / kentico-amp

Accelerated Mobile Pages module for Kentico EMS.
https://www.kentico.com/
MIT License
9 stars 14 forks source link

Allow AMP on relative paths #5

Open petrsvihlik opened 7 years ago

petrsvihlik commented 7 years ago

Currently, the AMP pages can be located only on different domains or subdomains. original: http://domain.tld/my-blogpost amp: http://amp.domain.tld/my-blogpost alt amp: http://different.tld/my-blogpost

It should be possible to set it up so that the AMP pages are served from the same domain as where the original content is located.

original: http://domain.tld/my-blogpost amp: http://domain.tld/amp/my-blogpost alternatively: http://domain.tld/my-blogpost/amp

Related to #4

kentico-timothyf commented 7 years ago

on this same topic - sub-subdomains are also not allowed by the current regex used for validation.

Example: https://amp.sub.domain.com

I was able to use some different regex and get it to allow sub-sub domains for our implementation, but it doesn't solve the subfolder issue you raised.

Regex I used: ^(?!.{256})(?:a-z0-9?.)+(?:[a-z]{1,63}| xn--[a-z0-9]{1,59})$

petrsvihlik commented 7 years ago

Can't we just use a standard (perhaps a bit modified) URI validation regex? https://mathiasbynens.be/demo/url-regex

Another option would be to leave out the validation completely.

petrsvihlik commented 6 years ago

notes added to #4

ponsss commented 5 years ago

Does it actually work on relative path like http://domain.tld/amp/my-blogpost? And if so, how to configure it?

petrsvihlik commented 4 years ago

@Kentico/platform-team could you guys please advise?