I have setup a multi lingual site using magento version 1.3.2.4 and have come accross some weird problems. Hoping that I could get some assistance.
The requirement was to add the new store view (dutch) and also maintain the current stores url structure, so I couldnt use 'Add store codes to urls' in the admin configuration as it would append the current urls with the default store code (fr). So, ultimately I needed the following url structures:
Default language (fr) url style : http://www.domainname.com
Dutch version url style : http://www.domainname.com/nl
For this I performed the the following steps:
I created a store view (code nl)
I created a folder by the name of nl
I copied the .htaccess and index.php from the main web root and pasted it in this folder
I modified the code as follows in index.php :
Mage::app()->getLocale()->setLocale('nl_NL');
$mageRunCode = 'Netherlands';
$mageRunType = 'store';
Mage::app()->setCurrentStore(1); // 1 being the nl store id
Mage::run($mageRunCode, $mageRunType);
When I launch the site, and goto http://www.domainname.com/nl the interface is in dutch as expected, but when I perform the following tasks I get redirected
back to the default language:
Login
Goto checkout/cart
Goto new user signup
Upon checking the view-source of the DOM I notice that some urls are pointing to the default language and not the nl language. For example the login form's action attribute is http://www.domain.com/customer/account/loginPost/ and not http://www.domain.com/nl/customer/account/loginPost/
Warm regards,
Hi instead of creating such a stuff .You can use this extension . Hope this help you and you can easily switch your language without creating a store view.
I got the same problem, cant have the same store code twice and when i try a new code it want link to the translation pack!
Related
As a new magento developer I'm using a theme to develop my store. I want to change the URL key of CMS page about. I followed the steps written here but I can't find my layout file for about page on the theme directory or base directory for change XML URL tag.
How can I edit the layout file? Can anyone help me?
Actually that tutorial is a little confusing because there, they are showing an example of changing a URL for two different type of pages (CMS and system).
For changing the URL of a CMS page, like about in your case, it's enough that you proceed until point 12. In short:
First. you change the URL from: (main menu) CMS/Pages/Your_Page -> Url Key: newURL
Then, find the blocks that it is used (e.g footer) and change the URL accordingly.
Plus, in general working in Magento after changing things like page URLs you need to do a reindex and in case of using cache you have to refresh/remove your cached data. Both could be found under System tab (Cache Management & Index Management).
This might be a basic question, I'm still relatively new to Magento. I have 2 store views in a magento project. 1 for English (default) and 1 for Japanese. While working with both store views, I noticed how if for example I switch to the Japanese store view, if I redirected to a different page or content on the store, the language goes back to English. How do I prevent the website from going back to the default language every time I change categories/catalogs?
That is all about Magento Admin setting. While creating Content Pages/Categories/products, there is a option that ask to choose Store View.
You can add content for Cateogries/Product/CMS Pages for each locale. If it is done then you'll be able to see your site content on the basis of current locale. Hence you need to go through Magento Admin first.
Hope it will work for you. Please let me know if any issue.
Managing contents in multilingual stores in Magento is easy.
Edit/Create Product/Category/Page/Static blocks according to need storeview and put content according to languages in that.
Now access pages by store code, if we are using that.
In some case we don't find the heading names according to languages so just enable inline translater from admin and do translation specific to store/website.
To run Magento store using urls we have both options index.php modifiction and using .htaccess using website and store codes.
On running Magento multisite , multistore. We generally face the common urls for media, js and other resources we should use symlink to increase SEO ranking and score.
Please feel free to contact.
Install your language package.
Create products, categories, pages, and static blocks on the basis of your selected language.
Sometimes translation does not work for few words. In those cases, Inline translation from admin will help you.
Managing content according to store view is very easy.
follow up below steps for managing content according to Store view.
Edit your product or category or your page and static block etc.
after that you can see store select left side in product and category and on page you can see feild below url in static block also. select your store view.
whater ever you want to change or edit please do according to you.
After that save it will apear only on your selected store.
Note: if you not edit any fild by store then it will show default store contents.
I've an website in dutch. http://www.domain.com and an german flag button to http://www.domain.com/german.
i have made an store view called german with a local language german.
How do i get to view this store view on the link www.domain.com/german
There are few ways for doing this.
1) Enable store code in the URL.
Magento allows you to add a store code of your store view to the URL. For instance, if your Dutch store view has a code dutch and your German store view has a code german, then Magento will automatically load a correct store. domain.com/dutch will load a Dutch version and domain.com/german will load the German version of your website. The drawback of this solution is a store code added even for the main domain.
The config setting can be found in Admin Panel (aka Back Office, BO) > System > Configuration > Web > Url Options. There you will find "Add Store Code to URLs" option.
2) Edit .htaccess file.
If you want to avoid the drawback of solution 1) you can modify your main .htaccess file. Add an entry that will search for /german suffix and will load the German store code. Here's a small example (I'm not an expert in this matter, but it should be something like this):
SetEnvIf Host .*domain.com/german.* MAGE_RUN_CODE="german"
You can play around with .htaccess more. Search the web if you want to learn more about .htaccess stuff.
3) Modify index.php of the application
This is very similar to the solution 2), but you do this directly in PHP. Find
$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : '';
line in index.php and replace it with something like this:
if (!$_SERVER['MAGE_RUN_CODE'] && strpos($_SERVER['HTTP_HOST'], '/german') !== false) {
$mageRunCode = 'german';
} else {
$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : '';
}
4) Add a new entry to the Apache vhost.
Create a new virtual host (vhost) for domain domain.com/german and put there SetEnv MAGE_RUN_CODE "german".
In my opinion the best option is the 2). It is the most flexible and you don't have to change any code. For development workstation 4) would be also sufficient.
Please note that these are only examples and they may not work on the first shot. I'm writing this from my memory and I cannot really check them now. Hope this gives you a brief idea how to handle your situation.
I have 1 website for now. Its URL is www.test.com, for example.
I want to create second website on the same domain adding store codes to URLs. So my URLs will be
www.test.com/first/
www.test.com/second/
But as I can see all my previous URLs will show 404 on their open. So if I open
www.test.com/product.html
it will show 404. It is not good because I loose my SEO.
How can I create redirects so if user opens
www.test.com/product.html
he will be automatically redirected to default website, like
www.test.com/first/product.html
Shall I have any issues with such redirects? (Like API will not work)
Or is it possible for URL
www.test.com/product.html
to show product from default website, if exists?
Magento has a very good system for SEO.
For Rewrite Management these are the steps:
1.Loginto Admin.
2.Move mouse over Catalog and you will find a drop down.
3 Select URL Rewrite management.
Catalog >> UrlRewrite Management
4.Then click on ADD URL Rewrite Button.
5.Then on next screen select custom from option provided
Create URL Rewrite : Select Custom
Now following important fields and values that should go:
Request Path (Old URL ) Target Path ( New URL ) redirect (Permanent 301).
Note : This approach will be good if you have few products but if you have too many product then some .htaccess rule is recommended.
I was advised by an SEO specialist that I should add a /aus/ sub-folder to my Magento installation for geo-target specific purposes.
So what I am trying to achieve is to add the same version of my store in a /aus/ sub-folder.
So basically that it would look something like this:
www.mystore.com/ <- my current store
www.mystore.com/aus/ <- for geo-targeting specific purposes
I do not want to run the /aus/ version on a separate installation or separate language, basically it should just add /aus/ to my current store and replicate all links there.
What is the best way to have this handled? Some recommendations or advises would be greatly appreciated.
Why not just add the store into the URL via configuration? Magento already has configuration for this. See System > Configuration > General > Web > Add Store Code to Urls.
Instead of yourwebsite.com/customer/account, it will now generate URLs like yourwebsite.com/<your_store_code>/customer/account.
Do note that all of your custom templates and modules should properly use the getUrl() Magento methods to build URL, otherwise these URL will not contain the storecode and end up not working.
add a new website "aus"
and then create new folder with index.php that run "aus" store