Skip to content

Unable to modify .htaccess in static directory #6285

Closed
@ihor-sviziev

Description

@ihor-sviziev

I have CORS requests issue with fonts when I using CDN. In order to fix it I'm changing my .htaccess. During deployment I do composer install. After that my changes were reverted.

Preconditions

  1. Magento 2.1.0 installed via composer
  2. Base Static URL is CDN domain (CloudFront in my case)

Steps to reproduce

  1. Install Magento 2 via composer
  2. Change your file pub/static/.htaccess (as example add Header set Access-Control-Allow-Origin "*")
  3. Remove vendor directory
  4. Do composer install

Expected result

My pub/static/.htaccess file should not be overridden.

Actual result

My pub/static/.htaccess file is overridden and my changes were reverted.

Possible solutions:

  • Do not add this file to map listing in composer.json of magento2-base package, move it to magento/product-community-edition package
  • Add ability to override htaccess

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions