开发者

redirect external subdomain traffic

I have apache installed on one of my server on two different ports, all http requests are handled by the apache on the default (80). Now I have a subdomain for a domain and I want the request for the sub domain to be handled by the apache on the other port (10024).

I've tried using

RewriteEngine On
Rewrite开发者_JAVA技巧Cond %{HTTP_REFERER} ^sub.domain.com$ [NC]
RewriteRule .* http://www.domain.com:10024/dir/page.php [R,L]

but dont get the required result.

Any suggestions?

Thanks in advance


Try changing HTTP_REFERER to HTTP_HOST and rewrite rule to:

RewriteCond %{HTTP_HOST} ^sub.domain.com$ [NC]
RewriteRule ^/$ http://www.domain.com:10024/dir/page.php [R,L]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜