How to add subdomain to Magento? - magento

I need to create geo subdomain for one city (for example shop.com & london.shop.com). I want the same store. But also I want to have different pages like:
london.shop.com/contacts & shop.com/contacts.
I use magento 1.9.2.1

you need to create multiple websites and store for different domain.create one folder on root and put index.php and .htaccess file and change in index.php store name or website name at last.
Please refer below link
http://inchoo.net/magento/how-to-set-multiple-websites-with-multiple-store-views-in-magento/

Related

Multiple Custom Admin URL

im trying to have the same backend but with multiple subdomains. first i created one of my subdomains in the backend has showen in this image above.
And is working fine, but not i need the same backend with another subdomain for example "sync.mydomain.com", but i cant find any information on magento docs in configuring custom admin url in multiple domains. Does someone have any idea if it is possible to configure it on magento?
In order to make magento work with multiple domains, you need to make few steps.
System->Manage Stores -> Create Store Fill in the store fields,
taking care that the Website and Root Category are the same as your
primary site.store. Save Store
Create Store View Fill in the store view fields, change Store to the
new store you just created, give your store view a Name (spaces ok),
a code and make sure it’s enabled, after that save the store view.
System->Configuration->Web Change the scope on the upper left to your newly created store view
Change Unsecure->Base URL to your second domain (You’ll have to uncheck Use Website)
Change Secure->Base URL to your second domain (You’ll have to uncheck Use Website)
Save Config
Open the .htaccess at the root of your Magento install
Add the following, obviously changing the values with your own:
SetEnvIf Host www.mysecondarydomain.com MAGE_RUN_CODE=yoursecondarystoreviewcode
SetEnvIf Host ^mysecondarydomain.com MAGE_RUN_CODE=yoursecondarystoreviewcode
Clear the cache and re-index the site.
Here is the article for more information:
http://madproject.com/programming/magento-one-site-multiple-domains/

Magento categories as subdomain

Is it possible to create urls for category as subdomain, for example now it is:
mystore.com/category
I would like it to be
category.mystore.com
I know there is multistore option, so I could create more websites and set root directory for every category, but there would be problem with cart sharing, next thing is site is has 2 languages - so I'm using multi store for site translation
There's no way to achieve this out of the box, but this can be done using a custom router. Create a custom router and insert it before the standard router. In your custom router, check the subdomain of the request. If it matches a category URL key (or whatever other criteria you'd like to use), rewrite the request to that of a standard category page (i.e. /catalog/category/view/id/123/). Keep in mind that your users will probably leave the subdomain when they click on a link because your base URL will not include the category-specific subdomain. Take a look at Mage_Cms_Controller_Router as an example of a custom router.

Magento multi-domain with seperate backend domain

Would is be possible to have Magento to be installed on domain-a.com but not using this domain as store front?
like this:
domain-a.com magento installation and backend access
domain-b.com store front 1
domain-c.com store front 2
The easiest way is to restrict the acccess to that domain only on your admin folder in your .htaccess or your vhost.
http://www.magentocommerce.com/knowledge-base/entry/tutorial-multi-site-multi-domain-setup
here is a good tutorial.

Magento Multiwebsite Configuration Setup

I am using multi website magento store having 3 websites for books,electronics and apparels in subdirectories like www.example.com/books, www.example.com/apparels. Is it necessary to include all folders like app, downloader, skin, etc in root folder to subdirectories or any other option is there because it seems to consume more memory for each one.
I manage one Magento site with two stores (two totally different URLs) operating from one instance of Magento. Each URL points to a different base directory on the hosting site. One directory holds the entire Magento installation. The second directory uses a combination of symbolic links and actual files as follows.
Symbolic links: app, errors, includes, js, media, skin, var
Actual files: .htaccess, index.php
www-root/directory1/[all magento files]
www-root/directory2/[symbolic links and .htaccess and index.php files]
You then set the insecure and secure base URLs for each store. In this case there is a separate root category for each store. And many of the Magento configuration parameters may be set individually for each store or use the default value.
No, you don't have to.
You can create multiple stores from system -> Manage Stores -> Create Store, if you don't have them already.
You can manage the url of the stores from system -> configuration -> Web and set secure and unsecure base url for each store by selecting the configuration scope on the top left.
E.g.: You can select the scope to 'books' store and set base url to www.example.com/books and set the scope to 'apparels' store and set base url to www.example.com/apparels.
Edit:
You also have to copy the index.php to the subfolder and edit this file. E.g. for www.example.com/apparels, add:
$mageRunCode = 'apparels';
$mageRunType = 'website';
before the line:
Mage::run($mageRunCode, $mageRunType);
Also try to copy the .htaccess to the subdirectory.
No, you no need to copy all folder , you need to create folder for books & apparels then copy your index.php and .htaccess file from magento root folder to existing folder (both books & apparels) also you need to set base url in magento adminpanel > system > configuration > web for new stores

Magento 1.6.2 Multiple Stores

I am trying to integrate multiple magento sites within the one installation. From what I have found i need to use a parked domain method however I have tried various methods to get it all working however I keep getting the 2nd store redirecting to the main store so I am looking for the best method to allow me to run multiple websites.
Any help is greatly appreciated
We currently have 4 stores all sharing one Magento installation & set of products. Each has it's own unique URL.
Create your Stores
Go to System -> Manage Stores
Click on Create Website. In the Name field, enter your store name. In the Code field, enter a unique code [lowercase & without spaces - we're going to give it a code of domain1 for our example] (to be used later) & Save.
Click on Create Store. In the Website field, select the website from step 2. In the Name field, enter a name. In the Root Category field, select the Root Category for your store & Save.
Click on Create Store View. Select the store you just created (from the dropdown menu) for Store. Type a name for your store in the Name field (Example from Magento is English Store). In the Code field, enter a unique string to identify the store view (just like for your store). Change the Status to Enabled & Save.
Repeat for all your stores
Configure your stores in the Magento Admin Configuration Section
Go to System -> Configuration
In the Store Scope (top-left dropdown), choose your first Store.
Choose Web from the Left-side menu
Open the Unsecure & Secure sections
Change the domains to what they would be (i.e. - http://www.domain1.com/) Don't forget the trailing slash at the end
Repeat for all stores
Server Config (for Magento versions 1.4.0.1 and greater)
Point your domain (e.g. - www.domain1.com) to your server where your single Magento instance is installed
Set up a Pointer/Parked domain on your server (see your Host's instructions or contact them)
In the .htaccess file on the root of your install, put in the following code for each of your stores
SetEnvIf Host .*domain1.com
MAGE_RUN_CODE=domain1 <- This was your important code from step 2 under Create your Stores SetEnvIf Host
.*domain1.com MAGE_RUN_TYPE=website
This set of 2 must be repeated for every domain you have.
For our particular stores/domains (might find useful)
Some servers, particularly those running Litespeed Web Server, the SetEnvIf directive does not get recognized in the .htaccess file. This was particularly true for us.
We had to do the following
Find RewriteBase / or RewriteBase /magento/ or etc
RewriteCond %{HTTP_HOST} .domain1.com [NC]
RewriteRule . - [E=MAGE_RUN_CODE:domain1]
RewriteCond %{HTTP_HOST} .domain1.com [NC]
RewriteRule . - [E=MAGE_RUN_TYPE:website]
We also have symlinks set up on our server (under each or our domains) to point to our main domain's folders (for the app, includes, js, lib, media, shell, skin, var)
Multi Store in Magento v1.6.2
in the VirtualHost configuration set the DocumentRoot to where you have your Magento installed (something like /var/www/magento), so it will be the same for every domain as we want only one Magento install for each domain
in Magento's admin, go to System -> Manage Stores and create your websites with their stores and store views (before that you'll have created one root category for each website). Reindex after everything is created
go to System -> Configuration and change the scope (the dropdown on the upper left) to one of the website. Go to the (General) Web -> Unsecure tab, uncheck the "Use Default" and indicate the domain in the Base URL field. Do the same for the secure
open the .htaccess at the root of your Magento install and at the end of it add the rules to determine which website to show according to the domain. For example, if you have set the codes website1 for domain1.com and website2 for domain2.com, put this:
SetEnvIf Host ^domain1.com$ MAGE_RUN_CODE=website1
SetEnvIf Host ^domain2.com$ MAGE_RUN_CODE=website2
SetEnv MAGE_RUN_TYPE website
and you're all set :)
HTH
Did you change your base urls for the second store configuration?
Navigate to:
System>Configuration>Web>Unsecure
System>Configuration>Web>Secure
Then change the Current Configuration Scope (top of left sidebar): your second store config
Deselect use default and enter your second store's path:
Base URL : http://yourdomain.com/
Secure Base URL: https://yourdomain.com/

Resources