From 1cdf535897b4d793ee6f908f9a45f903223682af Mon Sep 17 00:00:00 2001 From: ysh Date: Mon, 2 Sep 2024 10:02:32 +0900 Subject: [PATCH] WebConfig update --- src/main/java/kr/co/mcmp/config/WebConfig.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/kr/co/mcmp/config/WebConfig.java b/src/main/java/kr/co/mcmp/config/WebConfig.java index ec50511..a8f095f 100644 --- a/src/main/java/kr/co/mcmp/config/WebConfig.java +++ b/src/main/java/kr/co/mcmp/config/WebConfig.java @@ -6,14 +6,14 @@ @Configuration public class WebConfig implements WebMvcConfigurer { - @Override public void addViewControllers(ViewControllerRegistry registry) { - registry.addViewController("/web/{spring:[a-zA-Z\\-]+}") - .setViewName("forward:/index.html"); - registry.addViewController("/web/**/{spring:[a-zA-Z\\-]+}") - .setViewName("forward:/index.html"); - registry.addViewController("/web/{spring:[a-zA-Z\\-]+}/**{spring:?!(\\.js|\\.css)$}") - .setViewName("forward:/index.html"); + // 모든 경로를 index.html로 리다이렉트 + registry.addViewController("/web/{spring:[\\w\\-]+}") + .setViewName("forward:/index.html"); + registry.addViewController("/web/**/{spring:[\\w\\-]+}") + .setViewName("forward:/index.html"); + registry.addViewController("/web/{spring:[\\w\\-]+}/**{spring:[\\w\\-]+}") + .setViewName("forward:/index.html"); } }