本文介绍了使用apache vhost配置重定向到新域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个如下的apache虚拟主机配置.我希望所有来自
I have an apache vhost configurations as below. I want all my requests from
somedomain/loadproduct?product=dell-inspiron-15
要重定向到
someotherdomain/dell-inspiron-15 .
我可以从vhost配置中执行此操作吗?请注意,我在网址中有查询参数.
Can I do this from vhost configuration? Note that I have query parameters in the url.
Listen 12567 NameVirtualHost *:12567 <VirtualHost *:12567> ServerName somedomain ProxyPreserveHost On RewriteEngine On RewriteRule ?? </VirtualHost>这里的任何潜在顾客都非常感激.
Any leads here is really appreciated.
推荐答案您可以使用(代替RewriteRule ??):
RewriteCond %{QUERY_STRING} (?:^|&)product=([^&]+) [NC] RewriteRule ^/?loadproduct$ someotherdomain/%1? [R=301,L,NC]更多推荐
使用apache vhost配置重定向到新域
发布评论