Results 1 to 2 of 2
  1. #1

    Default Redirect user if comes form |AMP subdomain of the domain

    Hello, curently I'm strugling with AMP (Accelerated Mobile Pages) conversion of my store.

    I read this: https://github.com/ampproject/amphtm...-user-state.md
    and this https://ampbyexample.com/introductio...w-and-payments

    and many more... My conclusion is that AMP is not good for E-commers (especialy in this time period) because it has very downfalls...

    What is the situation:

    I have my store lets name it: my-store.com wich is non AMP and I have amp.my-store.com wich is the AMP version of my-store.

    I sucsesfuly managed to transform almost all parts of zencart to the AMP format but still strugling with: login, cart and all other cookie related parts of zencart because AMP does not use COOKIES instead uses USERID.

    In short if you visit first the AMP version its not possible to checkout or login or register.

    So what I decided to do is a shortcut but not as simple as I wanted it to be :)

    I want to Re-direct users to the checkout flow on my-store.com what I think will do the trick is simply to change all the add_to_cart, login, register links of buttons on the amp.my-store.com by simply removing amp. from the url...

    What it will be very nice for the custtomers is when they come from the amp.my-site.com to be redirected for example to the login2; register2 page wich will be styled to look the same as the amp version. Also when amp users register on the non AMP store to be redirected back to the AMP version.

    Is that possible, all toughts are wellcome.
    My most recent work: magprom.net

  2. #2

    Default Re: Redirect user if comes form |AMP subdomain of the domain

    I found this on stack, if I put it on the cart page (the page after login) will it do the trick or i have to take another aproach?

    PHP Code:
    //add any referrers that should be redirected to the array
    $refs = array('http://amp.my-store.com','http://another-domain.com');

    foreach(
    $refs as $r) {
       if(
    preg_match('/'.$r.'/'$_SERVER['HTTP_REFERER']))
         
    header('Location: http://my-store.com/login2');

    My most recent work: magprom.net

 

 

Similar Threads

  1. Migrating subdomain to a new domain
    By jmberman in forum General Questions
    Replies: 5
    Last Post: 17 May 2016, 07:21 PM
  2. v150 Can just the Admin folder be moved from SubDomain to domain
    By 2Geckos in forum Basic Configuration
    Replies: 1
    Last Post: 21 Aug 2012, 05:44 AM
  3. Change Domain Name to subdomain
    By raindrop2309 in forum General Questions
    Replies: 1
    Last Post: 13 Jul 2009, 07:43 PM
  4. Redirect Subdomain
    By seanIII in forum Basic Configuration
    Replies: 4
    Last Post: 27 Feb 2009, 03:02 AM
  5. Replies: 0
    Last Post: 26 Oct 2007, 12:55 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR