title: Disable access to .css files (a specific folder in main resource folder)
body: <p>I have searching the web for hours for this solution. I want to have access on <code>localhost/index.html</code> but not in <code>localhost/layout/style.css</code>.</p>
  
  <p>My static resources are from external folder and the filee tree goes as the obvious:</p>
  
  <pre><code>-&gt;site
     -&gt;layout
        -&gt;style.css
     -&gt;index.html
  </code></pre>
  
  <p>So far, all things i have tried, either disable access to index.html, either both index and style.css have access.</p>
  
  <p>The thing i found online that makes the most sense is:</p>
  
  <pre><code>@Override
      protected void configure(HttpSecurity http) throws Exception {
          http.authorizeRequests().antMatchers("/*.html").permitAll();
          // http.authorizeRequests().antMatchers("/**").permitAll();
          super.configure(http);
      }
  
      @Override
      public void configure(WebSecurity web) throws Exception {
          web.ignoring().antMatchers("/layout/**");
          super.configure(web);
      }
  </code></pre>
  
  <p>but when i use <code>localhot/layout/style.css</code> it shows the css file.</p>
  
  <p>my <code>WebMvcConfigurerAdapter</code>:</p>
  
  <pre><code>@Configuration
  public class StaticResourceConfig extends WebMvcConfigurerAdapter {
      @Override
      public void addResourceHandlers(ResourceHandlerRegistry registry) {
          registry.addResourceHandler("/**").addResourceLocations("file:mylocation/site/");
      }
  
      @Override
      public void addViewControllers(ViewControllerRegistry registry) {
          registry.addViewController("/").setViewName("redirect:/index.html");
      }
  }
  </code></pre>
  
  <p>Annotations on start up:</p>
  
  <pre><code>@SpringBootApplication
  @EnableWebMvc
  public class Main extends SpringBootServletInitializer
  </code></pre>
  
  <p>What would be the way to be able to see index.html but not all the css files inside layout folder?</p>
  
  <p>P.S: Maybe this is not even possible?</p>