How do I redirect a multi language site to a default language page? - redirect

I have this:
http://example.com/EN/index.php - english version
http://example.com/PT/index.php - portuguese version
What I want: http://example.com/ to be taken to the portuguse page by default.
I've also been thinking on having the portuguese page on the root and english in the EN/ directory. is this better for SEO?

iam not sure if i understand the problem, but you can create an index.php in your
root and change the header to forward the user to the PT/index.php
Header("Location: ./PT/index.php");
later you can construct an if/else check to verify the language of the browser etc..

Related

Can I exclude folders in a 301 redirect so that it only affects part of the web?

I have a question about applying redirects excluding some folders. Here you have my case:
My domain example.com is published in several languages:
example.com/es for content in spanish
example.com/it for content in italian
example.com/en for content in english
In my old website example.com/ the English content was under "/" (in the root of the project) but now it has been migrated to example.com/en leaving "/" without any content.
I want to apply a rule that all the content in English, indexed by Google hosted under example.com/ go to example.com/en but without this affecting the content under the other languages.
example.com/content1 redirected to example.com/en/content1
but mantaining unaltered:
example.com/es/content1es
example.com/it/content1it
...
That is, as indicated at the beginning, excluding the language folders and their child content. Is this possible?
Thank you very much

Page redirects automatically to front page

I have a page in two languages, Norwegian and English. The English page, when applying &L=1, only redirects to front page. I have no idea what's wrong.
I tried enable Development settings, but no error. Also I disabled all content elements on page but no change. I disabled RealURL, no change.
TYPO3 6.2.29
maybe you build wrong links in your language switcher.
disable realurl and have a look what links are generated. you probably miss the uid of the current page in the parameter.
how do you generate the language switcher link? language menu?
enhance your question with your configuration.

Redirect a domain from Joomla 1.5.11 to Wordpress on different domain

I have a question, I built a website for a client with a new domain (www.domain1.com) and new hosting. They have an old website with a different domain (www.domain2.com). The client requests that if someone clicks on www.domain2.com, that would take them to www.domain1.com. I built the website using WordPress, and the old website is built using Joomla 1.5.11 which doesn't have the option to use redirect under the Components option. I don't have any experience in Joomla 1.5.11 which is pretty old. Thanks in advance for looking into this for me.
Do you mean you want the domain to be redirected?
You can set up a 301 permanent wildcard redirect on your domain2.com to point to domain1.com.
Setting this up will also depend on the type of host you're using.
Also, you can set up an index.php file at the root of domain2.com to redirect:
<?php
header("Location: domain1.com");
?>
The problem with the above script is that you won't be able to do a wildcard redirect! But it can work with any Joomla! link, as Joomla's entrypoint is always set to index.php.
If none of the above is feasible for you, try adding more details about what you actually want to do.

How to redirect user in bootstrap after confirmation in Zend Framework?

I'm just new to Zend Framework. Currently what I'm trying to do is when user access my website
they will first see a select box with two language such as english and germany to choose.
Only when they make a selection, the browser will redirect them to the index controller of that specific language page.
So my question is how to make a select box in bootstrap file or any kind of possible ways to do that and how to redirect user after that? Any solution will be much appreciated!
Don't ever use bootstrap file (and I'm talking about both Bootstrap.php and index.php) for this kind of operations. First, it just won't work the way you ask; second, you'll mess your app's structure big time.
Instead you may use one of the following approaches:
1) add some predispatch hook that will check whether the choice has already been made by checking the user's cookies. If it is, proceed with request as usual (probably setting some Zend_Registry lang variable to be used later), if not, redirect for the language choosing page; the latter should store the choice made in cookies.
2) implement a simple rule in your Router/mod_rewrite: when the requested URL contains 'the language part' (http://example.com/lang/xx/... or just http://example.com/xx/...), it automatically uses this part so set the lang param. If not, the request is automatically redirected to the language choosing page. The latter, in turn, leads the user to a language-specific page, where all the links are made language-specific.
The latter approach is inferior, in my opinion, as user will have to use a language-tuned gateway all the time. But you don't have to store this info in cookies.
You could make a plugin that use the preDispatch event to look if the language has been chosen (e.g stored in cookie or session) and redirect to the landing page if not.
Look here zend framework plug-in - predispatch()
and the ZF's action plugin documentation.
That's what I do to force login in my app.
Now in your position what I would really do would be detecting the language of the user with a fallback to English and a switch widget somewhere in your navbar.

N2CMS - Multilanguage site and SEO friendly URLs

I have a N2 website with 2 languages: English and Serbian.
I want English content to point to mydomain.com/en
and Serbian content to point to mydomain.com/sr
How can I do that?
Today, URL for English start page is mydomain.com
And for Serbian start page: mydomain.com/Start/Index?page=127
All pages in my second language don't have SEO friendly URLs.
Any help would be greatly appreciated!
You need to organize structure of your site in a following way
Root
Language Intersection
Start Page EN
Start Page RS
Then, in web.config or config file in App_Data set StartPage to be ID of LanguageIntersection. One of the common causes of non-friendly URLs is that only pages below site start page (as defined in web.config) have friendly URLs. Hence, you must move your start page above each of language start pages.