I m试图进入网站:com/api to internally redirect to api.site.com。 现场:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^api/(.*)$ http://api.site.com/$1 [P,QSA,L]
</IfModule>
我安装了 mo子和 mo泥。 我做了什么错误? 这是否可行?
EDIT: site.com and api.site.com are on the same server. I wish to do the redirect as efficiently as possible. If there s a way to pass a request in a certain path directly to a file, ie /srv/www/api.site.com/index.php via mod_rewrite, that would be just as good.
问题在于有两个单独的实体,但绕过“javascript”政策。 代表不是一种选择,我希望能直接沟通。 JSONP不是一个选择。