can magento add store with different subdomain? - magento

it's my first time to use magento
my main domain for exmple domain .com with centos OS
my magento on store.domain .com with Ubuntu 16
can i use the same Ubuntu server for another store with sub domain store2.domain .com ?
P.S my main domain domain .com uses wordpress Cms
thanks

Yes. You Can add store with different subdomain. Follow below steps:
Go to admin then select tab System->manage stores
Click create store view and complete the form and save store view
Change the Base URL for each Store view
1.Go to admin then select tab System->configuration
2.On the left side of the page General under that select web but before that you have to change the Current Configuration Scope to your store view name
3.Edit the base url to you subdomain(eg: http://en.yourdomain.com)
4.click save config.
Change .htaccess for redirecting to store view if you call the subdomain
1.Your .htaccess file is at the root folder of magento.
2.Search for "RewriteEngine on" word in .htaccess file and write the code below it
RewriteCond %{HTTP_HOST} ^en.yourdomain.com
RewriteRule ^ - [E=MAGE_RUN_CODE:english]
RewriteCond %{HTTP_HOST} ^fr. yourdomain .com
RewriteRule ^ - [E=MAGE_RUN_CODE:french]
then save the .htaccess file and try to clear all cache and browsing history from your browser as well as from magento.

Related

Magento Remove index.php from URL

I have multiple websites installed in one Magento, and for one website, I have a full view store(www.example.com) and mobile view store(www.example.com/mobile). I have taken off the index.php from full store, but for somehow, it cannot be taken off from mobile store, I double checked, (1) Use Web server Rewrites set to yes (2) Use secure Url in frontend to yes (3) .htacess Rewrite Engine on and RewriteBase/. I cleared the Magento cache several times and I even reindexed. Why the index.php is still there?
Here is part of .htacess file.
## enable rewrites
Options +FollowSymLinks
RewriteEngine on
############################################
## you can put here your magento root folder
## path relative to web root
RewriteBase /
There are few step to remove index.php from url
Step1:Admin>System > configuration>General>WEb>Search Engine optimization
Use Web Server Rewrites enable to yes
Also Enable mod_write of apache
Follow the below steps to remove index.php from URLs in Magento
Step 1:
* Goto to your site root folder and you can find the htaccess file there.Open it on text editor and find the line #Rewrite Base/magento.
* Just replace it with Rewrite Base/
Step 2:
* Then goto your admin panel and enable the Rewrites(set yes for Use Web Server Rewrites).
* You can find it at System->Configuration->Web->Search Engine Optimization.
Step 3:
* Then goto Cache management page (system cache management ) and refresh your cache and refresh to check the site.
Try the Steps I have written in this blog post :
http://magentowebmaster.blogspot.in/2013/11/magento-admin-url-rewrite-set.html

how to redirect a link in my website to an external link?

I have provided a link from my web site in my andoird app which is:
www.mysite.com/support
And i want this link to be redirected to:
www.anothersite.com
i have already tried com_redirect and entered support as source and http://ww.anothersite.com but i dont get any redirects and i get 404 error.
I am running Joomla 3.x and i want to know how i can do this with URL rewrites and no external components.
It seems not possible to do it within the Joomla backend (i tried many combination of menu items and the redirect module).
For sure you can write your redirect directly in your .htaccess (if you are using it) like this:
RewriteEngine On # Turn on the rewriting engine
RewriteRule ^support/?$ http://www.anothersite.com/ [R=301,NC,L] # Permanent Move
or
RewriteEngine On # Turn on the rewriting engine
RewriteRule ^support/?$ http://www.anothersite.com [R,NC,L] # Temporary Move
More info about URL rewriting and .htaccess are here: http://www.addedbytes.com/articles/for-beginners/url-rewriting-for-beginners/

Magento - moving domain auto redirect to right url

i have magento 1.6.2. Plesk 11 on my linus Ubuntu 10.04 lts webserver (with root access)
My website is now on for e.g. on domain aaa.nl
We gonna rename the webshop and have a new domain for this. Like bbb.nl
A lot of sites have external links to our site ... like aaa.nl/shopby/boys.html
But when i set to redirect traffic from the old website to the new one (trough plesk 11) they are all redirected to bbb.nl (without the specific product or category)
How can i set magento up so when people now go to link aaa.nl/shopby/boys.html they automatically are redirected to bbb.nl/shopby/boys.html
Instead of doing it via Plesk 11 do it via .htaccess. Inside your Magento's .htaccess add this code just below RewriteBase line:
RewriteCond %{HTTP_HOST} ^(www\.)?aaa\.nl$ [NC]
RewriteRule ^ http://bbb.nl%{REQUEST_URI} [R=301,L]

creating admin folder inside CodeIgniter App

I have the front end fully working in a codeIgniter application. Now, I have to create admin as well. So, How would I create the admin section creating a new directory. Without interrupting codeigniter directory structure.
localhost/myapp/admin
CodeIgniter already supports 1 subfolder level within the controllers folder. So within /applications/controllers/ you can just add /applications/controllers/admin/ and it will work fine.
you could omit it out via .htaccess so that the directory actually works like a directory rather than how its initially developed to work.
RewriteEngine on
RewriteCond $1 !^(index\.php|admin|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
what this does is turn on apache modrewrite then tells apache any calls to index.php, robots.txt or yourdomain.com/admin/ (and any sub-folders/files within) treat as you would normally without codeigniter mucking up the works. Also this will remove the required index.php from the URL you will be able to link to your site like
mydomain.com/home/
instead of mydomain.com/index.php/home/
There's an explanation about that in CI User Guide: Managing your Applications

Generating sitemap.xml on multi stores

I have setup multistores on one Magento installation and all the stores are on different servers. I have created symlinks for each of them.
Now I want to generate sitemap.xml for each store. I have created a folder called sitemaps on my root directory, inside sitemaps I’ve created folders for each store. (i.e. store1, store2 inside sitemaps). Now I’m generating sitemap.xml inside them folders for each store. I’ve also add the following line in .htaccess of store1.com:
RewriteRule ^sitemap.xml$ http://www.mainserver.com/sitemaps/store1/sitemap.xml [NC]
(found this help here: http://www.magentocommerce.com/boards/viewthread/59388/)
Now if I type www.store1.com/sitemap.xml, I should be able to see the xml for that store but I’m getting 404 Not Found error.
Any ideas?
Copied from Magento stack
NOTE: I tried this way it always works.
First, create a new folder called sitemaps in the root of your website, then create subfolders for each domain.
/sitemaps/domain_1/
/sitemaps/domain_2/
Then login to the Magento admin and navigate to – catatlog -> google sitemap
Create or edit the sitemap listings for each store and set the “path to sitemap” field to be the path you created for the store.
/sitemaps/domain_1/
/sitemaps/domain_2/
Update your robots.txt file. To make sure that the search engine spiders are properly directed to the new sitemaps. You may need to update or create the robots.txt file. Edit the robots.txt file and add the following lines at the top —
# Website Sitemap
Sitemap: http://www.domain_1.com/sitemaps/domain_1/sitemap.xml
Sitemap: http://www.domain_2.com/sitemaps/domain_2/sitemap.xml
Finally, if your site uses the Apache web server engine, you should update the .htaccess file in the root of your website to direct any other sitemap requests to the proper place.
Locate the following line below the line that reads — RewriteEngine on
And add the following redirect statements below it —
# Sitemap: http://www.domain_1.com/sitemaps/domain_1/sitemap.xml
RewriteCond %{HTTP_HOST} ^.*domain_1\.com$
RewriteRule ^sitemap.xml$ sitemaps/domain_1/sitemap.xml [NC,L,R=301]
# Sitemap: http://www.domain_2.com/sitemaps/domain_2/sitemap.xml
RewriteCond %{HTTP_HOST} ^.*domain_2\.com$
RewriteRule ^sitemap.xml$ sitemaps/domain_2/sitemap.xml [NC,L,R=301]

Resources