我想重定向http://www.mydomain.com/service
到将为页面提供服务的服务端口在http://www.mydomain.com:PORT
哪里。PORT
是否有可能考虑到它正在侦听端口的 apache
80
将执行重定向,并且它是正在侦听的不相关服务PORT
?语法是什么?我尝试过类似的东西:
RewriteRule ^service$ http://www.mydomain.com:PORT
但我只收到
500
内部服务器错误。
感谢您的帮助。
编辑:
正如 Vinko 所建议的,错误日志中有一些有用的行:
[alert] [client 192.168.1.4] /path/to/the/site/root/.htaccess:
Invalid command 'Option', perhaps misspelled or defined by a module not
included in the server configuration
来自以下行:
Option +FollowSymlinks
现在它可以工作了,但是......地址改变了,我不希望它改变。我希望具有与经典重定向相同的行为,其中地址更改是透明的(例如mydomain.com/service > mydomain.com/?var=service
)。