你好吗?
在该线程中上一章的重定向和重写规则之后,重定向到除/ amp / Urls 以外的默认语言,我们的SEO代理建议我们更改URL站点。 com / fr,site / be到site.fr和site.be
after the previous episode of redirecting and rewriting rules in this thread: redirect to default language except for /amp/ Urls, our SEO agency recommended us to change the URLs site/fr, site/be to site.fr and site.be
我已经将旧网址的301重定向设置如下:
I already set the 301 redirections for old URLs as follow:
RewriteRule ^[a-z]{2}$ / [R=301,L] RewriteRule ^[a-z]{2}/(.*)$ /$1 [R=301,L]我知道这可以通过一条规则来实现但没有成功:/
I know this can be achieved in one rule but didn't manage to make it work :/
因为我现在删除了language文件夹,所以删除尾部的斜杠实际上并不能很好地工作。 site/test添加斜杠,因为文件夹 test存在并且是真实文件夹。我尝试关闭DirectorySlash,但返回了禁止的403错误。 请问如何解决这个问题?
since I now removed the language folder, removing the trailing slash does't really work well. site/test adds the slash because the folder "test" exists and is a real folder. I tried DirectorySlash Off but it returns a forbidden 403 error. please any idea how to solve this?
非常感谢
推荐答案下面我的评论:
将显示的两个规则合并为一个:
Combining those 2 shown rules into one:
RewriteRule ^[a-z]{2}(?:/(.*))?$ /$1 [R=301,L,NE]更多推荐
从实际目录中删除尾部斜杠
发布评论