DNN redirect mobile with dynamic article ID - redirect

I am using DNN 7 for my main site domain.com and m.domain.com for my mobile site.
The main site uses DNN 7 but the mobile uses MVC.
I am using fiftyOne to redirect my mobile site.
If I have 100 articles and this address to view a particular article: domain.com/default.aspx?id=n (where n=1-100).
If someone click on this link on a mobile device then this take them to the mobile site: m.domain.com because I set it in the web config file.
Is there a way to config so that it will take to the site m.domain.com/default.aspx?id=n ?
I heard that you can set the redirect rules in DNN but I am not sure if this can resolve the problem.
If you know the answer, please help.
Many thanks

sorry I found your question a bit hard to understand. But I think what you want is to redirect mobile devices to the appropriate pages? If so, then:
In the block of code that you use to detect if requesting device is mobile or not you can implement the following code:
Response.BufferOutput = true;
if (Request.Browser["IsMobile"] == "True")
{
string mobile_url = "m." + Request.Url.AbsoluteUri;
Response.Redirect(mobile_url);
}
This should take the requested URL "domain.com/default.aspx?id=n", append "m." in front of it so the URL becomes "m.domain.com/default.aspx?id=n" and then issue a redirect to the mobile URL.
On a side note: having a separate version of the website for mobile devices is not advisable as search engines consider it a duplicate content.

Related

App Store/Play Store redirection if App is not installed on ionic App

I have implemented deeplink for my ionic v1 application and also implemented universal link for same. I also checked so many links to implement App store redirection functionality.
Most of the link suggest to implement javascript code which first check device and based on ios/adnroid/window it will redirect to particular store but let say I will create that javascript code look like below
const iOS = !!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform);
if (iOS) {
window.location.href = "temp://itunes.apple.com/us/app/...";
}
but where should I put this file so when user click on deeplink it should redirect to particular this file and redirect to App Store/Play Store?
Let say I want to give my deeplink to some other server for which i don't have any access then what?
is there any other param or attribute we can set like fallback url by which when app is not installed it will automatically going to that particular link?
Any answer would be great help.
Thanks.
Usually it works that way:
You place a link on the website where you want to advertise your app. That link has a click tracking domain that points to your server. e.g. click.example.com/....
Upon clicking, if the app is installed, Universal Links would ensure that the app is opened. This is done by iOS (only if you configured Universal Links correctly, see https://developer.apple.com/ios/universal-links/). If the app is not installed, a redirect is done to your click tracking domain. This is where your Javascript logics should apply, so basically you need to reply to the request with a 302 redirect to an HTML file that contains the redirection logics (as in the example above). In that server response you can handle any fallback URL you want to use.
By the way, to make Universal Links work, anyway you had to host the AASA file, so you probably already created a server, so you can use it for the case where the app is not installed.

what is AppLink URL in FB.Mobile.AppInvite in Facebook SDK for Unity? and how to get it? or make it?

I am using Unity 5.3.4f1 and Facebook SDK for unity 7.4
The problem is poor documentation and not having step by step guide to facebook SDK FB.Mobile.AppInvite in:
https://developers.facebook.com/docs/unity/reference/current/FB.Mobile.AppInvite
FB.Mobile.AppInvite(
new Uri("www.HereGoesTheAppLinkUrl.com"),
new Uri("https://www.dropbox.com/s/vzl519vvf4hfe3j/3DTank1200X628.png?dl=0"),
AppInviteCallback };
The issue is what is AppLink? how to create it?any Csharp code for that?
where is the documentation regarding this subject? any guide example? anyone anything? am I even asking the right questions?
In a few newbie words - AppLink is a webpage full of meta headers. These meta headers redirect the client to appropriate application or store on their device.
E.g. if you create an AppLink page for MyXYZapp, which is an app for both iOS and Android, than probably you'll have a pseudo code in your AppLink page header like this:
//client is visiting the applink:
if the client is on Android:
try:
open app with bundle id `com.AndroidCompany.MyXYZapp`
else if MyXYZapp is not present on the device:
redirect client to Play Store page of MyXYZapp
else if the client is iOS:
try:
open `com.iOSCompany.MyXYZapp`
else:
redirect to AppStore page of MyXYZapp
else if client is visiting from any other OS:
redirect to AppStore / PlayStore via browser (or create your own behaviour)
EDIT:
Facebook itself now provides applinks, as described here:
https://developers.facebook.com/docs/applinks/index-api/
EDIT, THIS NO LONGER WORKS:
Now most people do not own servers to host these kinds of pages so facebook offers free hosting and very easy tool to generate AppLinks for your apps:
https://developers.facebook.com/quickstarts/?platform=app-links-host
read more here:
https://developers.facebook.com/docs/applinks/hosting-api
p.s. hope the URLs don't decay and dissolve through the coming centuries
p.p.s the URLs have decayed under 2 years. Crazy

Content not found Facebook

I have created my app page on facebook. I have added the required setting like Google Play Package Name, Class name and key hashes but still when try to access that app page it is showing below given error instead of taking us to play store. I have search a lot in web but did not get the relevant post. But I assume this issue can be fixed by facebook settings. I would really appreciate any suggestion.
I've gotten the same error, and as far as I understand, the field "Mobile Site URL" no longer works, as of July 2017. (Apparently there was some abuse of this system.)
In order to redirect to your website, an offical Facebook support encouraged to redirect to the mobile website from within the game itself.
Be advised that according to the Platform Policy, redirecting away from Facebook must be done through a user interaction such as a button click. It should not be done automatically.
A simple solution may be something like this:
if (window.innerWidth < 992 && window !== window.top) {
if (confirm("To get the full mobile experience, we recommend playing the game directly on our website. Would you like to play there?")) {
window.top.location.href = 'https://www.example.com';
}
}
Source:
https://developers.facebook.com/support/bugs/1051463851558493/?disable_redirect=0

Primefaces - How to redirect to mobile version?

I'm created a website in JSF 2 (primefaces 3.3) and now I want to create a mobile version. I have diferents views for desktop/mobile.
I already create a custom viewhandler to detect mobile browsers.
It seens to work fine. But what a don't understand is how to redirect the user to the mobile pages. I've searched a lot and nobody says where this step occurs.
In what step should i do that? Redirect the user, and how to?
Do the browser detection job in a Filter mapped on FacesServlet instead of in a ViewHandler.
It's then as easy as
if (needsRedirectToMobileURL) {
response.sendRedirect(mobileURL);
}
else {
chain.doFilter(request, response);
}
A ViewHandler isn't intented to manipulate the request/response. It's intented to handle the JSF view for the given request.
Generally you do not want to redirect to a mobile site but instead use css media queries to determine what the browser size is and use different css for that. Here is a quick example
http://css-tricks.com/resolution-specific-stylesheets/

Facebook App to Redirect to an external website

I am trying to get an App to redirect to an external website. I have found a company who has done it (See image). If you type in their name "Safarinow" the first result comes up which is an App. When you click the app you get redirected to "http://www.safarinow.com".
Would anyone know how to achieve this?
p.s. I am not actually a developer but rather a Social media manager so I have a limited understanding of coding etc. I have just been asked to find out how to do this for the lazy dev team.
Thanks in advance
That could be done by using Javascript in your application iframe. That javascript can change the top-url like that:
window.top.location = 'http://www.my-website.com/';
You just have to run this code when your website is loaded. For example by using jQuery:
jQuery(window).load(function() { window.top.location = 'http://www.my-website.com/'; });