且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

简单的Apache重定向问题

更新时间:2023-09-12 08:19:46

您只能指定的 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  http://example.com/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.