我的网站上只有一个入口点
example.com/AAA/BBB
所有对DB/应用程序的访问都是通过这个springmvc控制器进行的。
我想显示我的URL从上面显示到。
example.com/AAA-BB
这个想法是删除/AAA/BB,给出像AAA-BB 这样有意义的句子
我在Ubuntu和Springmvc 上使用apache2
有什么建议吗?
您可以在DOCUMENT_ROOT/.htaccess
文件中使用以下代码:
RewriteEngine On
RewriteBase /
RewriteRule ^([^-]+)-(.+)$ /$1/$2 [L]