我用的JAVA做的网站,如何才能使用伪静态
用rewrite,或者nginx的rewrite
package com.example;public class ExampleConfigurationProvider extends HttpConfigurationProvider{ @Override public int priority() {
return 10;
}
@Override public Configuration getConfiguration(final ServletContext context) {
return ConfigurationBuilder.begin()
.defineRule()
.when(Direction.isInbound().and(Path.matches('/some/{page}/.*/')))
.perform(Redirect.permanent('/new-{page}/'));
}
}
赞0
踩0