本文介绍了简单的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重定向问题
发布评论