-1

请您告诉如何使用 apache .htaccess 进行重定向:

http://www.domain1.com/products/?http://www.domain2.com/sdssds?%dfdf

http://www.domain2.com/sdssds?%dfdf

4

1 回答 1

0

通过启用 mod_rewrite 和 .htaccess httpd.conf,然后将此代码放在您.htaccessDOCUMENT_ROOT目录下:

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+products/\?([^\s]+) [NC]
RewriteRule ^ %1 [L,R=302,NE]
于 2012-10-10T10:32:49.173 回答