How to switch store in magento automatically basing on the visitors IP address - magento-1.5

I am using magento 1.5, I already created different stores in my store.
I created stores based on language.
English
Chinese
German
French
Spanish
i want to trap the the Ip address of the visitor. If the ip is from france, the store will automatically redirect to the french URL that i have created. If other countries it will redirected to the default store view.
thank you in advance.

I show this action Altought I havent tried it by myself.
Here is the link:
How to switch store views automatically
Basically, what it says is to add this code in the index.php, which is in the root folder of your magento system.
Good Luck!

You can use the method like Alberto have suggested.
But Add code to index.php file is not good because it is not upgrade friendly. It means if you upgrade to the latest version of Magento, you will loose all the edited index.php file because it was overwritten.
There are many Magento Extension can do this, you just have to "Google" it.
Or you can use this Magento extension. I use it and it is upgrade friendly.

Related

Updating an existing website. how?

If I have a website that runs in online, how do i update my website? I do not want any client to see the progress. Only the output. Using c panel to edit my website.
Make a note on your website saying website is down for upgrading/maintenance. Take it off internet. Work on your code duly, update and host it back.
Configure the. htaccess to display maintenance mode then change to normal mode after making the changes

Kentico multi language with multi domains

My build is English and French. I have a domain key for each in the system. I have my two cultures set as well, and I can not get this work correctly. my language toggle is based on the Kentico V8 Toggle, which currently gives the domain I Expect.
I'm making my changes in Chrome, and checking in IE, so I can see it not logged in.
Here's my setup:
My domain alias is set to the French URL and the french culture. Default path and Redirect URL are blank.
In Settings -> Content: Default culture is English. Combine check boxes are blank.
In Settings -> URLS - SEO - Cultures, all check boxes are empty
I've also noticed the culture class on the BODY tag doesn't change to FRCA.
I'm hoping this is something simple, but from the documentation, i can't see what I've missed. Also, is the license key different for a alias domain?
I've had similar problems with language switching in the past too. If your language switcher is custom code, try adding a lang querystring with value set to the target culture code (e.g. domain.fr/?lang=fr-FR). This has worked for me before.
This seems to be working. Not sure if there was a iis cache issue. I'm going to reboot my local dev, and try across multiple browsers.

Mediawiki Sitemap With short URLs

I have installed the mediawiki on my site like this: mysite.com/index.php/Main_page
I have used the Short URL method to change the url to mysite.com/Main_Page
What exactly I have to put on my robots.txt file?
I don't know how to follow this guide:
https://www.mediawiki.org/wiki/Manual:Robots.txt#With_short_URLs`
because the main install was on the root.
The linked tutorial is still valid, as long as you did not reconfigure your script URL (the one you see when editing pages).
Whether your robots.txt will work is another question; it will now reside in the same URL space as your wiki pages...

Wordpress Multiple Domains

I have an interesting question about functionality of wordpress latest version 3.8 (and all prior I believe).
I have a load of links which are relative to the "base domain" or the default domain. However unlike with usual relative URLs, wordpress means I can't have multiple default domains.
I this case (and I don't want to spam) I would like to have subduce.com and leedsweddingdj.com both pointing to the same site without it refering back to subduce.com whenever a link is clicked
Can anybody offer any thoughts/suggestions on ways round this problem?
Henry
If you update your wp-config.php file with the following code
define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST']);
define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST']);
You're server will take care of the rest. The only thing to note is that if you have links to either of the domains within posts and pages, you may find yourself hopping between domains.
Make a backup of your wp-config.php file before you do the above though, just in case things get weird.

Writing a htaccess file - RewriteBase?

Right I'll try and explain my situation as thoroughly as possible while also keeping it brief...
I'm just starting out as a web designer/developer, so I bought the unlimited hosting package with 123-reg. I set up a couple of websites, my main domain being designedbyross.co.uk. I have learnt how to map other domains to a folder within this directory. At the minute, one of my domains, scene63.com is mapped to designedbyross.co.uk/blog63 which is working fine for the home page. However when clicking on another link on scene63.com for example page 2, the URL changes to designedbyross.co.uk/blog63/page2...
I have been advised from someone at 123-reg that I need to write a .htaccess file and use the RewriteBase directive (whatever that is?!) I have looked on a few websites to try and help me understand this, including http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html however it all isn't making much sense at the moment.
Finally, scene63.com is a wordpress site, whether that makes any difference to how the htaccess file is structured I'm not sure...
Any help will be REALLY appreciated - Thanks.
I run my personal public website on Webfusion, which is another branded service offering by the same company on the same infrastructure, and my blog contains a bunch of articles (tagged Webfusion) on how to do this. You really need to do some reading and research -- the Apache docs, articles and HowTos like mine -- to help you get started and then come back with specific Qs, plus the supporting info that we need to answer them.
It sounds like you are using a 123 redirector service, or equivalent for scene63.com which hides the redirection in an iframe. The issue here is that if the links on your site use site-relative links then because the URI has been redirected to http://designedbyross.co.uk/blog6/... then any new pages will be homed in designedbyross.co.uk. (I had the same problem with my wife's business site which mapped the same way to one of my subdirectories).
What you need to do is to configure the blog so that its site base is http://scene63.com/ and to force explicit site-based links so that any hrefs in the pages are of the form http://scene63.com/page2, etc. How you do this depends on the blog engine, but most support this as an option.
It turned out to be a 123-reg problem at the time not correctly applying changes to the DNS.

Resources