首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何设置具体的RewriteRule?

如何设置具体的RewriteRule?
EN

Stack Overflow用户
提问于 2019-03-28 16:16:51
回答 1查看 21关注 0票数 0

我正在设置一个新的RewriteRule,网页将不会显示。它抛出一个HTTP-Error,比如404或BadRequest。这取决于我使用的组合。我通常想要使用的重写是可能的吗?

我们想要配置以下重写:

这种重写是有效的:

代码语言:javascript
复制
RewriteRule ^/context1/contetx2/context3/context4/Reisen.de.html  https://www.test.at/context1/contetx5/context6/2018/context7/Reisen.html  [R=301,L]

但是我们想要“删除”浏览器中显示的URL中的路径/位置"2018“。它应该看起来像:https://www.test.at/context1/contetx5/context6/context7/Reisen.html

我已经用R,QA,P,L,PT,ProxyPass,RewriteCond等等来做了很多的组合。

预期:输入URL:https://www.test.at/context1/contetx2/context3/context4/Reisen.de.html

在浏览器中显示(地址行):https://www.test.at/context1/contetx5/context6/context7/Reisen.html

可通过以下方式访问内容:https://www.test.at/context1/contetx5/context6/2018/context7/Reisen.html

EN

回答 1

Stack Overflow用户

发布于 2019-03-28 16:55:45

尝试:

代码语言:javascript
复制
RewriteRule ^/context1/contetx2/context3/context4/Reisen.de.html  /context1/contetx5/context6/context7/Reisen.html  [R=301,L]
RewriteRule ^/context1/contetx5/context6/context7/Reisen.html  /context1/contetx5/context6/2018/context7/Reisen.html  [L]
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55392889

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档