Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+5 votes
1.0k views
in Plugins by
Hi, I'm building the AMP plugin that would display AMP pages when the url ends with /amp.

I created a page module and trying to match the request with contain(/amp) in the URL.

I always get the native page rendred. How can I prioritize the amp over the native routing?
by
What is your desired URL structure? Something like this?

site.com/activity => site.com/activity/amp
by
Sorry my bad. I was testing on strpos() true? and 0 is evaluated as False.
by
As rule of thumb, never test with a double equal. Use triple equal so you should do strpos($string, $otherString) === false or strpos($string, $otherString) !== false
by
Thanks! I still have the issue. The plugin match_request() doesn't work on questions pages.
function match_request($request)
    {
        return true;
    }
Doesn't work on questions pages. Can you help?
by
What is your desired URL structure? Something like this?

site.com/123/amp => site.com/123/amp
by
site.com/123/title of question => site.com/123/title of qestion/amp
by
Any news on this, Aymane?

Please log in or register to answer this question.

...