Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

How can I point a subdomain to a specific folder? 
 
letthemstare
Jr. Member
 
Total Posts:  5
Joined:  2013-03-14
 

Hi,

1. I have a blog located under /var/www/html/wordpress directory
and an eCommerce maganto website under /var/www/html/magento directory.

2. I’ve created subdomain called ‘shop’ and I want to point it to /var/www/html/magento directory.
How can I point the subdomain shop.letthemstare.com to my magento eCommerce?

3. Here’s how my virtual host, I assume, should look like:

NameVirtualHost *:80

<VirtualHost *:80>
ServerAdmin
ServerName letthemstare.com
ServerAlias http://www.letthemstare.com
DocumentRoot /var/www/html/magento/
<Directory /var/www/html/magento/>
Options None
Order deny,allow
Allow from all
</Directory>
ErrorLog /var/www/html/magento/logs/error.log
CustomLog /var/www/html/magento/logs/access.log combined
</VirtualHost>

While searching for an answer, I came across the following tutorial:
http://davidpodley.com/2010/02/11/setting-up-subdomains-in-linode-and-apache/
But, I don’t know how to do in on centos (there is no a2ensite command in centos).

Any helpful response would be mostly appreciated.
Thanks and regards,

Kfir Silis

 
Magento Community Magento Community
Magento Community
Magento Community
 
Sindre|ProperHost
Mentor
 
Avatar
Total Posts:  1158
Joined:  2008-04-24
 

Is it not working with the vHost configuration you provided? It looks ok.

Are you running your own server or some hosting company? Is it Apache or some other web server? Do you have a control panel like cPanel?

Basically, you would just create the vhost for the subdomain, and then set the Base URL in Magento to the correct address.

 
Magento Community Magento Community
Magento Community
Magento Community
 
letthemstare
Jr. Member
 
Total Posts:  5
Joined:  2013-03-14
 
Sindre|ProperHost - 20 October 2013 11:26 PM

Is it not working with the vHost configuration you provided? It looks ok.

Are you running your own server or some hosting company? Is it Apache or some other web server? Do you have a control panel like cPanel?

Basically, you would just create the vhost for the subdomain, and then set the Base URL in Magento to the correct address.

1. I don’t know how to implement it, I’ve tried to modify the httpd.conf file but it didn’t work.
2. I’m using Linode as my hosting company, Apache 2.2.15 and don’t have cPanel.

Can you clarify your last sentence?
Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Sindre|ProperHost
Mentor
 
Avatar
Total Posts:  1158
Joined:  2008-04-24
 

If you don’t have the knowledge to manage Apache and don’t have cPanel, I suggest that you contact your host for assistance. They should be able to help. Is this a dedicated/VPS server? After you add the vhost you need to restart Apache for the changes to take effect.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top