Question about redirecting to...

User 2796156 Photo


Guest
3 posts

Hello:
I'm a developer helping someone with a Coffee Cup site. I have never used the software before, and she was asking where to insert the redirect code to send users to her mobile site. I would appreciate any quick directions to point me in the right way. Thanks!
User 103173 Photo


VP of Software Development
0 posts

If you just want to redirect Site A to Site B, you can do that with a meta-refresh. Just place this inside of the <head></head>:

<meta http-equiv="refresh" content="0; url=http://example.com/">
Learn the essentials with these quick tips for Responsive Site Designer, Responsive Email Designer, Foundation Framer, and the new Bootstrap Builder. You'll be making awesome, code-free responsive websites and newsletters like a boss.
User 2796156 Photo


Guest
3 posts

Thanks for the reply! I was specifically looking for information on detecting if the user was on a mobile device so it will automatically redirect them to the responsive version of the site. Any more info you can give me on that?

Thanks again!
User 122279 Photo


Senior Advisor
14,647 posts
Online Now

Try this wee script:
<script type="text/javascript">
<!--
if (screen.width <= 699) {
document.location = "mobile.html";
}
//-->
</script>


The screen width and the path to the file(s) for mobile viewing can of course be edited.

Just a hint: If your friend would use CoffeeCup's RSD, the site could be made to adapt to any screen size, and you/she wouldn't have the hassle of maintaining two versions of the site.
Ha en riktig god dag!
Inger, Norway

My work in progress:
Components for Site Designer and the HTML Editor: https://mock-up.coffeecup.com


User 2796156 Photo


Guest
3 posts

Thank you for the code! Where do I insert this code? I would really appreciate the help!

Thanks,
Danielle
User 434929 Photo


Ambassador
938 posts

dmpcooper wrote:
Thank you for the code! Where do I insert this code? I would really appreciate the help!

Thanks,
Danielle


How to Redirect Website to a Mobile Version when Accessed on a Mobile Device
https://www.youtube.com/watch?v=3epQ3KOMnyA

Redirect Mobile Devices
https://css-tricks.com/snippets/javascr … e-devices/
Guys at coffeecup are awesometacular.
User 187934 Photo


Senior Advisor
20,271 posts

dmpcooper wrote:
Thank you for the code! Where do I insert this code? I would really appreciate the help!

Thanks,
Danielle

Place it in between the <head></Head> tags.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.