Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Where do I insert a Redirect Script for my mobile site?

Where do I insert a Redirect Script for my mobile site?

Views: 3,280

Results 1 to 5 of 5
14 Aug 2012, 8:57 PM
#1
painted_hills_nb avatar

painted_hills_nb

New Zenner

Join Date:
Apr 2012
Location:
Fossil, OR
Posts:
35
Plugin Contributions:
0

Where do I insert a Redirect Script for my mobile site?

I inherited this project after it was up and running so I am not certian of all the answers from the Posting Tips: here goes.

  1. We are presently using: v1.3.9h.
  2. I don't believe it has been upgraded.
  3. Addons??? How would I determine this?
  4. We use FTP.
  5. Since I was not part of this project from the set up, I do not know what has been customized other than text and images added to pages.

I've searched the Forum and the FAQs, althought there are other redirect posts, they mainly focus on web maintainence or discontinued product. I have created a mobile site using GoMo - a Google inititave, powered by duda mobile. After creating the mobile site I received the following email:

We noticed that your mobile site http://mobile.dudamobile.com/site/natural-beef is live but your website visitors browsing on their phones still see your regular website. To get the most out of your mobile website, make sure your mobile visitors are directed to your mobile site by adding what we call a redirect script to your desktop website.

The following instructions were given for the redirect code.

*1. Open your website index.html file and paste the redirect code into the <head> tag

Redirect Code:

<script src="http://static.dudamobile.com/DM_redirect.js" type="text/javascript"></script> <script type="text/javascript"> DM_redirect("http://mobile.dudamobile.com/site/natural-beef"); </script>
  1. Save the index.html file and browse your site on your phone*

The only index.html file I could find is in the includes folder. Unfortunately, inserting the code into the head tag did nothing at all.

14 Aug 2012, 10:18 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Where do I insert a Redirect Script for my mobile site?

Oy ...
I question the suitability of that sort of alternative mobile site.
But I'm sure you didn't start this thread to debate your choice. You only want to know which file to use instead of the index.html they suggested.

Put ALL of that code into a new file located at: /includes/templates/NAME_OF_YOUR_LIVE_DESKTOP_TEMPLATE_FOLDER/jscript/jscript_duda.php
Create the jscript folder there if necessary.

20 Aug 2012, 10:26 PM
#3
painted_hills_nb avatar

painted_hills_nb

New Zenner

Join Date:
Apr 2012
Location:
Fossil, OR
Posts:
35
Plugin Contributions:
0

Re: Where do I insert a Redirect Script for my mobile site?

Thank you for the reply. Your time is indeed appreciated. However, we decided that the redirect was an inferior option as this would force mobile users away from our main site. The mobile site is for promotional use with QR codes and is not meant to be a substitute for the information on our main "desktop" site.

18 Oct 2016, 3:37 PM
#4
rongin avatar

rongin

Zen Follower

Join Date:
Feb 2009
Posts:
112
Plugin Contributions:
0

Re: Where do I insert a Redirect Script for my mobile site?

Hello, I have to add a duda script but the name they gave me for the redirect is m.domain.com. Also can you explain how to make the file do I go to html edit create a new file then add the code into it? The do I save it as you stated in this thread? or do I can the name to my m. domain which I think is right but don't know for sure.
Duda also said I would have to change the C-name in httaccess file would I have to also still do this after I get the code in?
Note:
I am using Westminster new zen cart v1.5.4
Thank you
Ron

18 Oct 2016, 5:17 PM
#5
rongin avatar

rongin

Zen Follower

Join Date:
Feb 2009
Posts:
112
Plugin Contributions:
0

Re: Where do I insert a Redirect Script for my mobile site?

thank you I have the redirect working I added the script from duda to the secret directory index template and the put in a CNAME now works.