Mobile app version of vmapp.org
Login or Join
Si4351233

: Apache returning incorrect bootstrap.min.css file Running Apache 2.2 on CentOS 7 I have a bootstrap.min.css file: /css/bootstrap.min.css It is version 2.2.1. However, when I go to http://example.com/css/bootstrap.min.css,

@Si4351233

Posted in: #Apache

Running Apache 2.2 on CentOS 7

I have a bootstrap.min.css file:

/css/bootstrap.min.css


It is version 2.2.1. However, when I go to example.com/css/bootstrap.min.css, I get a bootstrap file with version 3.1.1.

I've verified:


The file in the /css/ directory in the filesystem is 2.2.1 as expected
This is not a browser caching issue.
All other files in that folder work correctly...the bootstrap.css returns the correct file. It's only the bootstrap.min.css that doesn't work.


In short, apache is simply returning the wrong file, and I've never seen anything like this before. We've had 3 sets of eyes on this to confirm the problem.

We do have a single rewrite rule on the server:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^_router.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /_router.php [L]
</IfModule>


However, this would result in a routing error if it were being used. So, it is not a rewrite issue.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Si4351233

1 Comments

Sorted by latest first Latest Oldest Best

 

@Si4351233

Solution: remove the /etc/httpd/conf.d/welcome.conf

The Apache welcome.conf file has some Alias values that affect the website and cause it to return files from the /usr/share/httpd/ directory instead of the site 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


It was just pure coincidence that we happened to even have a bootstrap file with version 3.1.1 in our directories...and it explains why they were slightly different.

In any case, this means that anyone who uses the path /css/bootstrap.min.css on their website (very common setup) may have similar problems where the version they are expecting and the version the browser is getting are different.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme