How to load a different language URL depending on the visitor's IP in a multingual site? [closed] - multilingual

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
Some time ago I developed a multilingual website and now they have asked me that the website should load the language depending on the visitor's IP address. They are going to provide me with an IP address list of different countries.
For example. If an italian visitor loads the website, the website should load www.mydomain.com/it
If the IP is not recognised, the website should load www.mydomain.com
How can I achieve this?
Thanks in advance.
Regards

I found a solution and it worked perfectly for me.
I found a site which provides a database table with all the necessary ips and locations. The site can be found at:
http://www.ip2nation.com/
You can download both the sql dump and the php code sample from there.

You could also use the Accept-Language request header:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
http://www.w3.org/International/questions/qa-lang-priorities.en.php
You could write a redirect in Apache or NGINX to redirect to a different site based on that header.

This is one of Joomla plugins that help you in such case.. But this works only if your site is a Joomla site.
extensions.joomla.org/extension/language-domains
Else, set redirects to each language domain.. there are many ways for doing this.. you can google for these.
Solutions above are provided based on the idea of setting a domain to each language/country (EXP: .jp, .ir,. de,etc....)
If you have only one domain, with content is divided lingually in directories (site.com/ar, site.com.jp, site.com/en) you can set links in homepage.. if you want this to be done automatically create a script to get visitor`s country and automatically redirect him to his content.. this step can be done easier with solutions recomemnded for you earlier.

Related

Angulas 1 & Angular 2 - Hide api calls...possible? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I think I know the answer, but I'd like more opinions.
Imagine a scenario...
You create a new website using angular 1 or 2 where basically your front end application consumes services from a server that's send you results in json - The trivial scenario.
Then a competitor decide to create one web site to compete with yours. It's pretty easy to open Developers Tools on the browser and check the address of the rest server including api parameters. So, the competitor decides to create a migration tool to make easy for people to abandon your web site and adopt the competitor web site.
CORS cannot protect you because it's much more a browser feature - also you can use JSONp to consume api of different domains.
So, the question: Is there any solution for a scenario like this ?
You can obfuscate your API, but you can't hide the calls that are made to it.
There's a single good reason for this : the browser of the final user needs to know what requests to make, and make them.
Even if you found some way to hide the requests made from the Developper Tools, someone could still retrieve them by listening for them on the network.
However as I said, you can still obfuscate your API so that trying to replicate it would require non-trivial work. That way, an understandable request like
GET /user/id1234/profile?history=true
could become the less talkative
GET /1/id1234/p?x=1

Hybrid Mobile App online Database [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I'm currently building a Hybrid mobile app using ionicframework,angularjs and cordova,in my app i will need some data storage such as all users details.
What i'm trying to figure out is how to update the database for all users,for example if a new user signs up,he should be added to the database and everyone else should be able see his profile instantly,i'm thinking the database should be shared online instead of just updating the local database installed with the app,i'm currently using SQLite plugin to store such data but i'm not sure if it's the right choice for my case.
Does anyone know how to reach what i want ? i would appreciate any help.
Thanks.
Too many users then no point in storing and syncing. Creates more data inconsistency issues and resource consumption.
Online is the way to go.
If there is a subset of users whom u want to store information then thats an option.
Like watsapp stores and syncs information of those who are on your contact or chats only and not the whole watsapp db.
Thank you guys,after a lot of research,few days ago i decided to use Firebase,it's really powerful and works perfectly with angularJS and ionicframework which i'm using to build my app. I would really recommend it in situations similar to mine.

Connecting to Heroku DB via Android APP with play on server side [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I am new to Heroku and playframework.
trying to create a project where i can update and read DB via android / ios app i am developing.
I would like to create some sort of service using play framework that when requested by android/ios app will update db (security here is important).
how do i create such service ? if answer is to complex is there a tutorial i can be flowered to ?
appreciate the help.
EDIT:
I realize my question might be general/unfocused (due to my own lack of knowledge).
i will try to elaborate.
my purpose is to build an app for my kids kindergarten where the caretakers can update messages to parents in the website interface and the application will read these messages from the data base. i understand it is not recommended that an application read directly from DB but use a service. as my web site is built with playframework and hosted on heroku i was wondering how do i get this all to connect ?
Actually it's hard to guess what are you asking about...
I'd suggest to build JSON API with Play application which handles JSON requests, from your mobile apps. Quite simple case, however you ned to put some effort for planning.
Although we don't know much about your approach, most probably hmac signature for authentication will be good enough for this kind of job.

How to get my HTML code into a published webite [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I feel like this is a simple enough question that it should have already been asked and answered, but I have not seen anything on it in my searches.
I am creating a website for my club at school, and need to publish it/make it live/public, whatever you want to call it. Thusfar it is a simple HMTL-only document, but once I get it up and running I will expand it with CSS and Javascript (as I learn them, haha). So how do I turn this HTML file into a real website? Here is some key info:
The HMTL code is sitting on my desktop in a file (blablabla.html)
I have server space allocated for me, provided by the school. No need to find a domain.
I am familiar with using ssh to visit said server, and I have successively used scp to upload my html file to the server address, but when I navigate to the webpage though Chrome, I get an Object Not Found/404 error.
I'd like to do this the old fashioned way for now, but if there are any reccomendations for web publishing suites on Ubuntu, they are welcome.
So what exactly do I need to do to make it a working webpage? Is there a specific place I need to put the .html file, a specific name it must have? What am I missing?
P.S. For once I do get it working, how do I obtain/upload some MIDI music to give my website that good old fashioned early 90s feel?
yes, try to rename it to index.html if that file is you home page.
At what URL are you trying to reach your website? http://example.com/mysite/ ??? or maybe http://example.com/mysite/blahblah.html ??

How to let google index my database driven pages - that are not direcly linked to [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
Hi in simple terms have a company listing website.
I have a database of companies people can search and results are shown - fine.
Now what I want to do is open my database or these database driven pages to google so they can be indexed - so in an ideal world if someone searches for 'xyz company' their profile on my company listing website could be dispalyed in the search results.
As these pages wont all have direct links to them how can I get google to spider them?
Thanks!
EDIT***
OK to clarify they will be accessible by links ie "site.com/company?id=1" maybe even seo friendly urls if I can sort out dupe company name issues. It was more that the actual links wont all be listed on the site but now as others have suggested I can return all of these to a sitemap.xml but as per BiAiB's comment Google sounds like it will cap the number they will index...
I like the idea of a company by county page though that would work with direct links.
You should make an XML sitemap, then submit it to Google Webmaster Tools.
Google have a page about it here: http://support.google.com/webmasters/bin/answer.py?hl=en&answer=156184
Another way would be to make an HTML sitemap that contains all the pages, and have a link to it in the footer. Without any links to the content, Google will likely not think it's very important, and won't give it high rankings.
Your ideal solution is to create a contextual link structure to all your businesses.
This not only lets Google find your businesses but also helps Google categorise them.
It would probably also help your visitors.

Resources