简单的Apache重定向问题

编程入门 行业动态 更新时间:2024-10-25 08:27:24
本文介绍了简单的Apache重定向问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想建立一个简单的Apache重定向URL的重定向到网址B.

I would like to set up a simple apache redirect that redirects URL A to URL B

答: HTTP://myURL.example/msc3/fr

乙: HTTP://myURL.example/msc3/fr/index_fr

Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteRule myURL.example/msc3/fr myURL.example/msc3/fr/index_fr

我想我接近,但它不工作。

I think I am close but it is not working.

推荐答案

您只能指定的 URL路径在 重写规则 ,.htaccess文件中只是没了上下文路径preFIX的URL路径(在本例的情况下, / )。所以:

You can only specify the URL path in RewriteRule, in case of the .htaccess file only the URL path without the contextual path prefix (in this case /). So:

RewriteRule ^msc3/fr example/msc3/fr/index_fr

请注意,这将匹配的路径中的任何URL只是开始的有 / MSC-3 / FR 为 ^ 标记字符串的开始。

Note that this will match any URL that’s path just begins with /msc3/fr as ^ marks the start of the string.

更多推荐

简单的Apache重定向问题

本文发布于:2023-11-01 23:03:39,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1550665.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:重定向   简单   Apache

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!