スポンサーリンク

httpd 2.4の環境で違うbootstrap.min.cssが読み込まれたときの備忘録

httpd2.4がインストールされている環境に対して、ComposerでCakePHP3のプロジェクトを新規作成したときの話。
/css/bootstrap.min.cssというパスで読み込まれるようなCSSファイルをアップロードしたところ、どういうわけか正常に読み込まれなく解決に時間が掛かったので備忘録としてまとめました。具体的にはアップロードしたbootstrap.min.cssのバージョンがv3.3.5なのに動作確認の際にブラウザで読み込まれるcssのバージョンがv3.1.1という現象が発生しました。

この現象について調べたところ、conf.dディレクトリ内のwelcome.confという設定ファイルの中で定義されているエイリアスが原因のようでした。

# 
# This configuration file enables the default "Welcome" page if there
# is no default index page present for the root URL.  To disable the
# Welcome page, comment out all the lines below. 
#
# NOTE: if this file is removed, it will be restored on upgrades.
#
-<LocationMatch "^/+$">
-    Options -Indexes
-    ErrorDocument 403 /.noindex.html
-</LocationMatch>
-
-<Directory /usr/share/httpd/noindex>
-    AllowOverride None
-    Require all granted
-</Directory>
-
-Alias /.noindex.html /usr/share/httpd/noindex/index.html
-Alias /css/bootstrap.min.css /usr/share/httpd/noindex/css/bootstrap.min.css
-Alias /css/open-sans.css /usr/share/httpd/noindex/css/open-sans.css
-Alias /images/apache_pb.gif /usr/share/httpd/noindex/images/apache_pb.gif
-Alias /images/poweredby.png /usr/share/httpd/noindex/images/poweredby.png
+#<LocationMatch "^/+$">
+#    Options -Indexes
+#    ErrorDocument 403 /.noindex.html
+#</LocationMatch>
+#
+#<Directory /usr/share/httpd/noindex>
+#    AllowOverride None
+#    Require all granted
+#</Directory>
+#
+#Alias /.noindex.html /usr/share/httpd/noindex/index.html
+#Alias /css/bootstrap.min.css /usr/share/httpd/noindex/css/bootstrap.min.css
+#Alias /css/open-sans.css /usr/share/httpd/noindex/css/open-sans.css
+#Alias /images/apache_pb.gif /usr/share/httpd/noindex/images/apache_pb.gif
+#Alias /images/poweredby.png /usr/share/httpd/noindex/images/poweredby.png

全部コメントアウトしhttpdを再起動したところbootstrap.min.cssが読み込まれるようになりました。

タイトルとURLをコピーしました