Hello @farihkh
Thank you for reaching out to us, yes you can customize AMP URL Structure and endpoint, To change the AMP endpoint from /amp/ to /mobile/, please add the following code in your child themes functions.php or in a custom plugin.
/**
* Modifies AMP slug to "mobile".
*/
add_filter(
'amp_query_var',
function() {
return 'mobile';
}
);
Please refer to our documentation for paired URL structure for further possibilities of changing URL Structure.
We hope this helps!
OK, if it’s for a custom URL amp but using a subdomain, is that possible? example being m.upted.id?
Also ask, for example if I share the amp URL. but when I access it using a PC, why isn’t it redirected to non-amp? Please help
Hi @farihkh ,
Following up on your question about creating a subdomain with amp as the prefix. eg: amp.mywebsite.com
Yes, it’s definitely possible. I shared an article on paired URL structures that explains this concept in detail. You can find it here: Paired URL Structure. Additionally, the article includes a code snippet as an example.
Here’s another point to consider: If you provide the URL of your AMP page, there’s no need to worry about redirects to non-AMP versions. Since they’re already high-performing pages, redirects aren’t necessary.
Here’s why: When users search for something on a mobile device, the search engine results page will automatically direct them to the AMP cached version if it exists. On the other hand, searches on a PC will take users directly to the non-AMP version.
Please let me know if you have any other questions!
@farihkh As we didn’t receive a response I’ll mark this as resolved. Feel free to open a new support topic if you require any further assistance.