TYPO3: Show language names for default language in speaking URL using RealURL - seo

I set up a TYPO3 website using TYPO3 4.7. The website is bilingual (German/English) and the are 'speaking' using RealURL.
The default language is German.
So far it works nicely. I get URLs like:
http://www.mywebsite.something/neuigkeiten
http://www.mywebsite.something/kontakt
If the user changes the language to English, he gets URLs like:
http://www.mywebsite.something/en/news
http://www.mywebsite.something/en/contact
If the changes the language back to German, he gets URLs like:
http://www.mywebsite.something/de/neuigkeiten
http://www.mywebsite.something/de/kontakt
The problem is: This creates duplicates for search engines. So, I would like the default language also to use the language parameter for German 'de' as a default in the URLs before the user changes the language.
Does anyone had the same problem before?
Thank you, Chris

Try not to define dafault language in realurl config.
Smth like this should be enough:
array(
'GETvar' => 'L',
'valueMap' => array(
'en' => '1',
),
'noMatch' => 'bypass',
)

Related

.NET Routing contain case sensitive?

I was working with routes in .NET Core and I noticed that when I use the same route but passing it with a lowercase letter, I got access to the same page.
Example:
mydomain.com/Account/Login
mydomain.com/account/login
Why was there no distinction between uppercase and lowercase in this case? And I am not using services.AddRouting (options => options.LowercaseUrls = true); to allow this.
I just want to know how that letter distinction works and why it continues to work.
Quote from the Doc :
Text matching is case-insensitive and based on the decoded representation of the URL's path.
And services.AddRouting (options => options.LowercaseUrls = true); is just used to convert the route template to lowercase. But you can still access it with uppercase Url.

.htaccess how to display long sub-directory urls as short urls in address bar?

I've been trying to solve this problem for a couple of days now.
My root folder is https://www.example.com, I have many articles on it but in different folders and sub-folders for better organizing.
The problem is that I want links to look better and not like:
> https://www.example.com/reviews/review_1/index.html
/review_2/index.html
/review_3/index.html
or
https://www.example.com/articles/blog/content_1/index.html
/content_2/index.html
/content_3/index.html
but instead, I want all folders under "reviews and articles" to appear like root/dirs:
https://www.example.com/review_1/index.html
https://www.example.com/content_1/index.html
...so is it possible to exclude ../reviews/ or ../articles/blog/ folder somehow, but to have the same directory structure and also not to have duplicate content, indexes or duplicate DIRs?
EDIT / I found the solution:
Options +FollowSymLinks -MultiViews
RewriteEngine on
RewriteRule ^review_1/(.*) reviews/review_1/$1
This code will redirect from folder reviews/review_1/ to unexisting folder review_1 on root and copy all content from reviews/review_1/ to review_1.
just create an associative arrow specifying the mapping between url's and what they mean under the hood, for example I use in php like this-
$route = array(
array(
'url' => 'review_1/index.html',
'map_to' => '/articles/blog/reviews/index.html'
),
array(
)
);
or better version like implementing simple routing-
$route = array(
array(
'url' => '/review/',
'controller' => 'controller_class',
'action' => 'model_class'
),
array(
)
);
better proceed with second process..
do some research in implementing routing yourself or use basic framework.
Hope it helps.

using yii rest api with default URL GET format rather than PATH format

I have a problem with a yii rest api. I configured it to work following the tutorial on the yii framework page, but after that i realised that my api works BUT NOT some big PORTIONS of my PAGE since it is based on the GET URL format rather than PATH which is required by the rest api.
So in my config/main.php i have the following setting
'urlManager' => array (
'urlFormat' => 'path',
'rules' => array (
'student/<id:\d+>/<title:.*?>' => 'student/view',
'students/<tag:.*?>' => 'student/index',
array (
'apistudent/register',
'pattern' => 'api/<model:\w+>',
'verb' => 'POST'
),
'<controller:\w+>/<action:\w+>' => '<controller>/<action>'
)
),
I also have a controller named ApiStudentController with a method called actionRegister().
So as already stated the api works normally but my page does not since i set the urlFormat to be 'path'.
The question is... how can i use the rest api but without the PATH url format and rather the default get url format (index.php?r=apistudent/register)?
I too faced the same problem in yii 1.x. I just need my API controller alone in old GET format rather than in PATH format (as i changed my websites URLs in PATH format). Finally i got it worked with a small hack in script file
$app = Yii::createWebApplication($env->configWeb); //store the app
//Change the UrlFormat for urlManager to get if a get request is given instead of a path format one.
if (isset($_GET['r'])) {
Yii::app()->urlManager->setUrlFormat('get');
}
$app->run(); //run the app
I dont know whether this solves your problem. But this can give you an idea. Happy Coding!

how to translate strings via php from a module in prestashop?

I'm building a new module. As stated by the docs, I'm using the l() on a module's function, with a syntax like this:
$subtitles = array(
'22' => $this->l('Per acquisti superiori ai 50€'),
'23' => $this->l('30 giorni per sostituire o rendere')
);
I also can see, edit and save that sentences on tha backoffice translation page.
But if I check for ex. $subtitles[22], I always get the italian version, not the english one. Note that I checked also that $this->context->language->id corresponds to english.
So what's the problem here?
Ok no, THAT'S the right way. My problem was only that I was ehm.. choosing the wrong language to translate on the backoffice.. Pardon.

yii does not translate korean language

In database, I set language code of Korean - 'ko', but when yii print errors, these errors is english default like this: 이메일 cannot be blank..
Semilar with Maori...
So, what exactly language code of these languages?
And where I can see list of language codes which supported by Yii?
Thanks...