{"id":167,"date":"2012-08-24T15:05:02","date_gmt":"2012-08-24T15:05:02","guid":{"rendered":"http:\/\/openmenu.com\/help\/?p=167"},"modified":"2015-04-28T19:20:28","modified_gmt":"2015-04-28T19:20:28","slug":"redirecting-to-your-mobile-site","status":"publish","type":"post","link":"https:\/\/openmenu.com\/help\/redirecting-to-your-mobile-site\/","title":{"rendered":"Redirecting to Your Mobile Site"},"content":{"rendered":"<p>Now that you have your OpenMenu, and received the free website site we give you, you want to redirect mobile visitors to your website to your restaurant&#8217;s mobile site on OpenMenu that stays in sync with all your menu changes.<\/p>\n<p>Sample: <a href=\"http:\/\/openmenu.com\/m\/restaurant\/sample\">http:\/\/openmenu.com\/restaurant\/sample<\/a><\/p>\n<p>The address for your restaurant&#8217;s mobile site is in the format of: http:\/\/openmenu.com\/restaurant\/OpenMenu_ID . If you&#8217;re having trouble identifying your mobile site&#8217;s URL use our <a href=\"http:\/\/openmenu.com\/locate.php\">Search<\/a> tool to locate your restaurant. A link to your mobile site and <a href=\"http:\/\/openmenu.com\/blog\/2011\/07\/what-is-a-qr-code-and-why-does-my-restaurant-need-one\/\">QR Code<\/a> is provided.<\/p>\n<p><strong>Redirecting from an existing page:<\/strong><\/p>\n<p>Now that you can access your complimentary mobile site you can safely redirect your mobile site to our page. Using one of the codes below your mobile site can easily, and properly, perform a redirect.<\/p>\n<p><em>PHP<\/em><\/p>\n<pre>&lt;?php\r\n  header (\"HTTP\/1.1 301 Moved Permanently\");\r\n  header (\"Status: 301 Moved Permanently\");\r\n  header (\"Location: http:\/\/openmenu.com\/m\/restaurant\/OPENMENU_ID\"); exit(0);\r\n?&gt;<\/pre>\n<p><em>ASP.NET<\/em><\/p>\n<pre>&lt;script runat=\"server\"&gt;\r\n private void Page_Load (object sender, System.EventArgs e) {\r\n   Response.Status = \"301 Moved Permanently\";\r\n   Response.AddHeader(\"Location\",\"http:\/\/openmenu.com\/m\/restaurant\/OPENMENU_ID\");\r\n }\r\n&lt;\/script&gt;<\/pre>\n<p><em>Javascript<\/em><\/p>\n<pre>&lt;script type=\"text\/javascript\"&gt;\r\n&lt;!--\r\nwindow.location = \"http:\/\/openmenu.com\/m\/restaurant\/OPENMENU_ID\";\r\n\/\/--&gt;\r\n&lt;\/script&gt;<\/pre>\n<p><em>ASP<\/em><\/p>\n<pre>&lt;%\r\n Response.Status=\"301 Moved Permanently\"\r\n Response.AddHeader \"Location\", \"http:\/\/openmenu.com\/m\/restaurant\/OPENMENU_ID\"\r\n%&gt;<\/pre>\n<p><strong>Detecting a mobile device:<\/strong><\/p>\n<p>If you are interested in auto-detecting a mobile device to redirect the visitor for them you can use this MIT License <a href=\"http:\/\/openmenu.com\/help\/wp-content\/uploads\/2012\/08\/class-mobile-detect.zip\">mobile detection script<\/a> (php).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Now that you have your OpenMenu, and received the free website site we give you, you want to redirect mobile visitors to your website to your restaurant&#8217;s mobile site on OpenMenu that stays in sync with all your menu changes. Sample: http:\/\/openmenu.com\/restaurant\/sample The address for your restaurant&#8217;s mobile site is in the format of: http:\/\/openmenu.com\/restaurant\/OpenMenu_ID [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-167","post","type-post","status-publish","format-standard","hentry","category-developers_designers"],"_links":{"self":[{"href":"https:\/\/openmenu.com\/help\/wp-json\/wp\/v2\/posts\/167","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/openmenu.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/openmenu.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/openmenu.com\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/openmenu.com\/help\/wp-json\/wp\/v2\/comments?post=167"}],"version-history":[{"count":11,"href":"https:\/\/openmenu.com\/help\/wp-json\/wp\/v2\/posts\/167\/revisions"}],"predecessor-version":[{"id":610,"href":"https:\/\/openmenu.com\/help\/wp-json\/wp\/v2\/posts\/167\/revisions\/610"}],"wp:attachment":[{"href":"https:\/\/openmenu.com\/help\/wp-json\/wp\/v2\/media?parent=167"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/openmenu.com\/help\/wp-json\/wp\/v2\/categories?post=167"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/openmenu.com\/help\/wp-json\/wp\/v2\/tags?post=167"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}