Configure apache on elastic beanstalk

前端 未结 4 726
难免孤独
难免孤独 2020-12-02 17:24

I\'m developing with django on elastic beanstalk and I want to make two changes to apache configuration:

1. redirect www.domain.com to domain.com

2. redirect

4条回答
  •  误落风尘
    2020-12-02 17:54

    Just for reference for others, using Zags' solution to redirect non-www to www, add this to your .ebextensions/your_file.config:

    files:
        "/etc/httpd/conf.d/www_rewrite.conf":
            mode: "000644"
            owner: root
            group: root
            content: | 
                RewriteEngine On
                
                RewriteRule ^(.*)$ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
                
    

提交回复
热议问题