【发布时间】:2020-04-03 05:52:47
【问题描述】:
我正在对 .htacess 文件进行一些更改,我想捕获请求的 url,创建它的子字符串并将其传递给第三方 url。 例如
我正在开发 ubuntu,所以目前我的 .htaccess 文件在文件夹 test 中。因此,当我访问 localhost/test/http://www.facebook.com 时,它会将我带到 service.prerender.io/test/http://www.facebook.com 但我想消除“测试”并转发像 service.prerender.io/http://www.facebook.com 这样的请求
这是我的 .htaccess 文件的代码
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/script.php
RewriteRule ^(.*)$ http://service.prerender.io%{REQUEST_URI} [L,QSA]
</IfModule>
【问题讨论】: