.htaccess - 使用 htaccess 进行简单重定向

标签 .htaccess url redirect url-rewriting

我知道这是一件简单而快捷的事情,但是网站会在几个小时内上线,而且我对 htaccess 没有任何经验,所以我希望有人能对此提供一些快速帮助。

所以我想要的是我有 html 文件根文件夹。文件是 index.html、german.html、swedish.html、spanish.html、danish.html。现在我想拥有该 URL,以便德国站点位于 www.domain.com/de swedish www.domain.com/sv english/default 位于 www.domain.com/en 等等。这应该可以与htaccess有关吗?

或者有更好的方法来做到这一点?

非常感谢!

最佳答案

创建一个包含以下内容的 .htaccess 文件:

Redirect permanent /german.html http://yourdomain.com/de
Redirect permanent /swedish.html http://yourdomain.com/sv
....
我希望这就是你所提到的,它会有所帮助:)

关于.htaccess - 使用 htaccess 进行简单重定向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5291736/

相关文章:

c# - 将 BitmapImage 转换为 Image.Source

linux - 将 awk 输出重定向到 bash 中的文件

内置服务器的 PHP Storm 无法识别 mod_rewrite

css - htaccess 重写条件错过 css 和图像

linux - DDOS 模组重写 IP 请求

.htaccess - htaccess mod_rewrite 允许 ipv6

python 库从网站获取内容(http 文本)?

ios - 将二进制文件下载到文档目录 (IOS)。如何?

Grails:从被调用方法重定向

HTTP 重定向 (302) 在以下 GET 请求中不使用 Cookie