WordPress deployment for multiple websites and countries - php

I have a website e.g www.mysite.com and it content is in english. Now I need a feature which allows users to choose their residing country and directly take them to URL something like www.mysite.com/en/US. My questions:
How do I do the redirection from one url to another ?
Can I customize that the www.mysite.com/en/US will have more or less pages ?
How do I implement language selection for this scenario ?
Do I need more than one WordPress installation for this ?
Any tips or references is most welcome.

Download http://wordpress.org/plugins/qtranslate/, it's free and very easy.
It detect language from browser and you just need to set default language
see also http://www.wpmayor.com/best-wordpress-multilanguage-plugins/ for more info.

Related

How to read subpages on server?

Can I get a list of files on any page?
For example on page
www.90minut.pl/
Every news on page is in folder "news" eg.
www.90minut.pl/news/238/news2387307-Deniz-Yilmaz-nie-zagra-z-Legia.html
I would like to see all files on
www.90minut.pl/news/
Is it possible in PHP?
No.
Unless the site provides you with links, there is no way to tell what resources it is hosting.
of course you can, but, you have to pay attention if the structure from the website/system is using structure like MVC or it's using friendly urls, and the server's permission it's setted as read mode or read/write.

Redirect my website joomla

I want to redirect my website in differents languages when detect the country by (GeoIP), actually i have these urls and works well clicking on the flag images.
www.myweb.com/en www.myweb.com/es www.myweb.com/pt
But i dont know how to do it in joomla using the geoip.
I tried with .htacess and the answer of this question
how to redirect domain according to country IP address
and i have the error 500
SOLUTION:
Joomla provides a browser settings in system language plugin, just setting the joomla with this works perfectly!!
This extension does the job: http://extensions.joomla.org/extensions/style-a-design/templating/11173 Note that it's commercial. Your alternative would be download the GeoIP database (it's available for free), and then create a small plugin that does the redirection.
If you want, you can take a look at our post here: http://www.itoctopus.com/how-to-block-a-whole-country-on-your-joomla-website on how to block a country. You will only need to slightly modify the code to make it so that it redirects to another page for a certain country.
Try this,
Create a system plugin for Joomla
PHP functions available for checking visitors country use that identify the location.
redirect according to that.
Hope it helps..

Let facebook choose the right language with my share link

I have a multi-languages website (en_US + fr_FR), I made it using CakePHP.
The first time a user comes to my website, the language will be define using the $_SERVER['HTTP_ACCEPT_LANGUAGE'], or the default language (en_US) if $_SERVER['HTTP_ACCEPT_LANGUAGE'] is not set.
So the problem is that my OpenGraph tags are differents depending on the language, but the Facebook scraper doesn't have any $_SERVER['HTTP_ACCEPT_LANGUAGE'] var... so he'll always choose the default language (en_US), even if the user that clicked on the Share Link was French.
So my question is :
How can I force Facebook to choose a different language when scraping my webpage.
I already took a look at this url : https://developers.facebook.com/docs/opengraph/guides/internationalization/ but I didn't understand anything...
Please, help !
(actually I'll have to do the same thing with Google+ share link too... but Facebook is more important right now)
EDIT :
My webpage URL doesn't change when the language changes. It's always http://my-website.com/
EDIT 2 :
I think I managed to make it works.
The answer was really in the doc : https://developers.facebook.com/docs/opengraph/guides/internationalization/ but it was really hard to understand.
But now how can I change my language in Facebook to check that it really works (because now, it always gives me the French translation instead of the default language) ?
Actually, I had to add a way to set the website language using the URL :
http://my-website.com/en/ or http://my-website.com/?lang=en
It is much more easier this way to share my website in different languages AND this is a recommandation from Google

Changinging Joomla template according to the url open in the browser, how?

I am asking if is it possible do the following thing using Joomla
I have 2 different URL, something like: www.stupidname.com and www.seriousname.com
If the user open stupidname.com by his browser will open the website having a stupid template
If the user open seriusname.com by his browser will open the website having a serious template
The website and the content are the same...should only change the template according to the url open in the browser
Do you have some ideas about how to do this thing?
Thanks
Andrea
I've done this before making elements of a template conditional based on the domain name, and that can work well. I suppose you could extend the same logic to change the template.
Perhaps you could add a conditional to both template's index.php to change the template. Perhaps something like...
if ( substr_count( $_SERVER['HTTP_HOST'], "silly") ) {
$GLOBALS["mainframe"]->setTemplate = "silly_template_name";
} else {
$GLOBALS["mainframe"]->setTemplate = "serious_template_name";
}
...I've not tested this, but I think in principle it should work fine, though it might depend on which Joomla version you have.
There are, as saji89 pointed out, plenty of good multi-site extensions and that'd be an ok solution too.
From my personal experience with Joomla I can advise you to use the component Virtual Domains (http://extensions.joomla.org/extensions/core-enhancements/multiple-sites/7557) you can add the domains which you redirect to the main site where Joomla is installed and it this component you assign them the template you want.
I can confirm the functionality on Joomla 2.5 latest update with usage of around 5+ different Virtual Domains on one Joomla installation.
Some possible downsides i want to mention:
SEO links can get sometimes messy, you need to play with some SEO component and its settings
its better to use same structure and components for boths side its easier because otherwise the administration gets messy but its possible
the user which register on one website has automatically account on all of them because its one Joomla

How to make static Dynamic pages?

In MyBB forums you must have seen that all those threads are stoed as forum.com/Thread-Name-of-the-thread
So now this is static right ?
So now i have a site which has
blog.com/search.php?=SEARCHED+TEXT
So now how do i save this search so that Google can find out this page on my site ?
Indirectly what i mean to say is how i can i make
blog.com/SEARCHED+TEXT.html
"So now this is static right?" No. Just because the URL doesn't end in .php or similar doesn't mean it's static. It's time for you to learn the wonders of mod_rewrite:
http://www.workingwith.me.uk/articles/scripting/mod_rewrite
Your first example isn't static at all. It's just using a tool to route the request based on the URL.
All you need to get the same functionality is to investigate URL Routing in PHP and implement it in your application as well.
If you want Google to index this search page you have to tell Google it exists, either through a Sitemap or by putting a link on your site that Google can crawl. Google did fill in forms in the past, but I am not sure if they still do and afaik, they only did on a selected few sites.
To make the search static, you have to render the page once and store it in a file. Whether you do that manually by simply calling up the file in your browser and then saving it or by means of a Caching System is up to you.

Categories