简单的apache重定向问题
我想设置一个简单的apache重定向,将URL a重定向到URL B 答:简单的apache重定向问题,apache,url,rewrite,Apache,Url,Rewrite,我想设置一个简单的apache重定向,将URL a重定向到URL B 答:http://myURL.example/msc3/fr B:http://myURL.example/msc3/fr/index_fr Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteRule http://myURL.example/msc3/fr http://myURL.example/msc3/fr/index_fr 我想我很接近了
http://myURL.example/msc3/fr
B:http://myURL.example/msc3/fr/index_fr
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule http://myURL.example/msc3/fr http://myURL.example/msc3/fr/index_fr
我想我很接近了,但它不起作用。对于.htaccess文件,您只能在中指定URL路径,而没有上下文路径前缀(在本例中为/
)。因此:
请注意,这将匹配路径以/msc3/fr
开头的任何URL,因为^
标记字符串的开头
RewriteRule ^msc3/fr http://example.com/msc3/fr/index_fr