English 中文(简体)
内部转往另一个有 mo改(或类似)的虚拟主机
原标题:Internal redirect to another virtual host with mod_rewrite (or similar)

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不是一个选择。

问题回答

图2

RewriteRule ^api/(.*)$ /library/api.php/$1 [QSA,L]

/library/api.php将指数说明直接列入/srv/www/api.site.com/index.php。 它不得不将一些参数改写在“SERVER”美元中,但从一个皮点开始。 营地是一个单一州,比我的目的多。





相关问题
Using SimplePie with CodeIgniter and XAMPP

I am using CodeIgniter 1.7.2 with XAMPP 1.7.2 on a Windows computer. I am trying to make use of SimplePie. I followed all the instructions I could find: a copy of simplepie.inc is in my applications/...

Multiple Sites with common files

I have developed over 50 sites that all use the exact same files other than CSS and IMAGES, I currently duplicate the files each time I create a new site and upload different css and images. What ...

http server validation

I finish a litle http server, writing from scratch. I would like to be sure that my imlementation is conforme to the HTTP specifications. W3C give us tools for HTML/XML conformance, but i see nothing ...

热门标签