我已在Tomcat服务器上部署了我的角度应用程序。如果用户在我的项目域之后输入任何错误的链接,则应将其重定向到主页。考虑abc是我的项目名称,例如
然后应将他重定向到
我试图在本地tomcat服务器上实现.htacees,将其放在我的tomcat目录apache-tomcat-8.5.6的其他目录中
F:\ C \ apache-tomcat-8.5.6 \ .htaccess
F:\ C \ apache-tomcat-8.5.6 \ bin \ .htaccess
F:\ C \ apache-tomcat-8.5.6 \ conf \ .htaccess
F:\ C \ apache-tomcat-8.5.6 \ webapps \ .htaccess
F:\ C \ apache-tomcat-8.5.6 \ webapps \ ROOT \ .htaccess
F:\ C \ apache-tomcat-8.5.6 \ webapps \ abc \ .htaccess
F:\ C \ apache-tomcat-8.5.6 \ work \ Catalina \ localhost \ ROOT \ .htaccess
我的.htaccess如下
RewriteEngine On
# If an existing asset or directory is requested go to it as it is
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteRule ^ - [L]
# If the requested resource doesn't exist, use index.html
RewriteRule ^ /index.html