Sub domain mapping to a page - google-app-engine

I'm creating an HTML page (GWT Module) for mobile browsers, It's currently on "www.mydomain.com/Mobile.html".
How can I map this sub domain "m.mydomain.com" on App-Engine to view this page and keep the address bar showing "m.mydomain.com"?

i would suggest to have responsive site instead of creating separate subdomain for mobile.
if you insist follow the link, it might help you
https://cloud.google.com/appengine/docs/domain#more_about_wildcard_subdomain_mapping
alternatively you could write js code to redirect user based on resolution of device
<script type=”text/javascript”>
if (screen.width <= 699) {
document.location = "http://example.com/Mobile.html"
}
</script>

I couldn't find a way to do this properly from GAE, So As a workaround I created a "URL Frame" also known as "Frame Redirect" or "URL masking" from my domain registrar to mask my html page with the sub-domain wanted.
So far, I don't see any problems with this.

Related

AdSense and AngularJS application -- approval

My website is a Single Page Application written with AngularJs.
I am trying to add AdSense for some pages. After submitting, my site was rejected because of the following reason: "Insufficient Content".
My question here is: were adSense crawlers able to access and view my website considering that we use escaped_frangment and phantomJs to render the pages? (This works pretty fine for google bots.)
What can I doto make my website approved by adSense?
Thanks in advance.
I've used Prerender successfully in the past. It was a bit of a pain to set up, but works very nicely.
Search engines and social networks are always trying to crawl your
pages, but they only see the javascript tags...
We render your javascript in a browser, save the static HTML, and you
return that to the crawlers!

single page application with angularjs and google+ button

I used this https://stackoverflow.com/a/20537386/744040 solution to define the content of the Facebook sharing window.
I can't find a similar solution for Google +.
I am working on this website http://sportnews.codeskeleton.com/ and if you go to an article page and try to G+, it'll take a wrong image as thumbnail and for the title it takes the AngularJS code : Sportnew7-24 - <% Page.title() %> (I use <% instead of {{ to avoid collision with blade ).
I tried the solution with schema.org but the google popin seems to ignore them.
Thank you
Google+ share details are populated by Google making an HTTP request to the specified URL and parsing the HTML. Since you are making a SPA site Google is just parsing the default template details without executing your JavaScript. If you want Google+ sharing details to work you will have to render the HTML with the title/image in it.
Google does have a method for telling crawlers about AJAX pages and how to crawl them but I can't speak to if the Google+ bot supports the standard.

Ionic / Cordova with embedded video takes over web view

In a simple Ionic app I have a plain web view with some embedded videos. These embedded videos are included with an oEmbed iframe. Video works fine, but almost every video provider has a link to watch the video on the provider's page. For example Youtube always has a button 'watch on Youtube'.
When my users (accidentally) click that link, the whole Cordova web view is taken over by the linked URL. Instead of my app it shows the Youtube video. Then the user never gets to go back to my app, except by closing and opening the app.
I've tried to:
Prevent navigation by watching $locationChangeStart, that doesn't work as it doesn't fire for external URLs (like Youtube's).
Prevent navigation by using window.onbeforeupload, but that doesn't suffice as it doesn't guarantee the user navigates away and it presents an ugly confirmation popup.
Any other ideas on how to prevent navigation to external URLs from an Ionic/Cordova app would be highly appreciated.
You should provide more info, how do you insert the videos? some code?
I don't use videos, but I had a similar problem with google maps, if the user clicks the legal link, the page nativate to the google legal page and the user can't go back.
To fix this, I installed inAppBrowser plugin and used this code to open the legal page inside the inAppBrowser window
$('#map_canvas').on('click', 'a', function(e){
e.preventDefault();//you prevent the default click
window.open($(this).attr('href'), '_blank');//you open the link on the inAppBrowser window
});
So you should inspect the video to see if you can do something like this, preventing the link click and opening it on the inAppBrowser plugin
You will have this problems using externa players, a possibel solution would be to host the videos on your server and use some jquery/angular video player.
insert
<script type="text/javascript" charset="utf-8" src="cordova.js"></script>
in your index.html. So when you open a link,it'll use your device browser.You can come back from the device browser to your application with android back button.
You should probably give your url's like this
var ref = window.open('https://www.******.com/', '_system', 'location=yes');

Setting up angularjs app for crawling

I have an angular app set up to work in html5 mode with a #! fallback, so on most browsers it works with http://example.com/foo/bar and on less cool browsers we get http://example.com/#!/foo/bar. All that seems to work.
I have been going through trying to get google to crawl the site nicely, and it doesn't seem to be working as expected. I have set up <meta property="fragment" content="!" /> in the page to signify to google to recrawl with ?_escaped_fragment_=, and set up nginx to redirect to a static version of the page when it receives a request like this.
It is working for the front page - looking in the access logs I can see http://example.com/?_escaped_fragment= and can google "A sentence from the front page" and get the home page back as a result.
However it is not working for any of the interior pages, if I look in the access logs I can see a whole bunch of http://example.com/foo/bar/?_escaped_fragment_= rather than http://example.com/?_escaped_fragment_=/foo/bar/ as I might have expected.
Is there anything obvious I am missing to make google do what I want it to?
I think that is for AngularJS apps with HTML5 routes, and indeed, you should see requests with just ?_escaped_fragment_=, not ?_escaped_fragment_=/foo/bar/. For more info check section "3. Handle pages without hash fragments" here, https://developers.google.com/webmasters/ajax-crawling/docs/getting-started.

My mobile site does not render on certain mobile phones. Why?

I am developing a basic mobile site in asp.NET and C# and am having problems rendering .aspx pages on certain mobile phone browsers.
I tried Stackoverflow.Mobi on a nokia looking for good examples for coding mobile sites.
As soon as I redirect to another page I receive the error "File Format Unknown."
As soon as i use the button_click event to transfer to another page the "File Format Unknown." shows up on the mobile divice.
I have tried the following as suggested fixes from numerous forums but without any luck.
Setting Page contentype : ContentType="text/html"
Server.Transfer
Response.ContentType = "application/xhtml+xml";
Response.Redirect("Test.aspx");
Posting to the Full URL www.XXXX.com/test.aspx
One of the phones i am having problems with is a Nokia 6300
Any suggestions?
Normaly this is a problem with doc-type, because asp.net changes it to wap/application. I will recommend you use Fiddler for checking http headers. Normaly,Page directive ContentType should solve it
<%# Page Language="C#" ... ContentType="text/html" %>
But you have set :-S
Make sure your html passes w3c validation. I know Blackberry device will have trouble displaying pages where the Html does not validate according to the doctype.

Resources