1

after reading the official guide here Magento Guide I have setup my magento this way:

  • I have created one website in english and one in spanish
  • I have configured Apache this way
<VirtualHost *:80>
        ServerName www.mywebsite.devcom
        ServerAlias www.mywebsite.devcom
        DocumentRoot /var/www/magento/
        ErrorLog /var/log/mywebsite/es/error.log
        CustomLog /var/log/mywebsite/es/access.log combined

<Directory /var/www/magento>
  Options FollowSymLinks
  AllowOverride All
  Order allow,deny
  Allow from all
</Directory>
</VirtualHost>
  • I have configured HTACCESS this way
RewriteCond %{HTTP_HOST} ^(.*)mywebsite\.devcom
RewriteRule .* - [E=MAGE_RUN_CODE:base]
RewriteCond %{HTTP_HOST} ^(.*)mywebsite\.devcom
RewriteRule .* - [E=MAGE_RUN_TYPE:website]

RewriteCond %{HTTP_HOST} ^(.*)mywebsite\.deves
RewriteRule .* - [E=MAGE_RUN_CODE:spain]
RewriteCond %{HTTP_HOST} ^(.*)mywebsite\.deves
RewriteRule .* - [E=MAGE_RUN_TYPE:website]
  • I have configured Magento backend to have different URL for base url and static files url enter image description here

The result is that Magento is loading the HTML page but all static content have 404 error since doesn't load from domain cdn.mywebsite.deves.

I have checked my configuration and I don't understand if there is an error in the Magento guide or something in my setup or a bug in the Magento code.

Anybody is experiencing the same issue?

  • mod rewrite is ON on Server? – Ankit Shah Sep 27 '16 at 9:48
  • Hi, yes mod_rewrite is enabled on the server and in my host file on my mac I have added the cdn DEV domain and I can ping the server correctly from that domain, I really don't know why magento is accepting just the www and ignore any subdomain. Is my htaccess rule correct? – Marcos Lamba Sep 28 '16 at 8:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.