Apache htaccess使用参数重定向到新域
我需要通过htaccess从Apache htaccess使用参数重定向到新域,apache,.htaccess,mod-rewrite,Apache,.htaccess,Mod Rewrite,我需要通过htaccess从abc.com/param重定向到test.bcd.com/?query=param 对吗 RewriteEngine on RewriteCond %{HTTP_HOST} !^(www\.)?test\.bcd\.com$ [NC] RewriteRule .* http://test.bcd.com/?query=%{REQUEST_URI} [R=301,L] 请试试这个 Options +FollowSymlinks -MultiViews Rewrite
abc.com/param
重定向到test.bcd.com/?query=param
对吗
RewriteEngine on
RewriteCond %{HTTP_HOST} !^(www\.)?test\.bcd\.com$ [NC]
RewriteRule .* http://test.bcd.com/?query=%{REQUEST_URI} [R=301,L]
请试试这个
Options +FollowSymlinks -MultiViews
RewriteEngine on
RewriteCond %{QUERY_STRING} ^query=param [NC]
RewriteCond %{HTTP_HOST} !^(www\.)?test\.bcd\.com$ [NC]
RewriteRule ^ http://test.bcd.com%{REQUEST_URI}?%{QUERY_STRING} [R=301,L]
要重定向到index.html,请尝试以下操作
请添加以下两行以允许加载特定文件,以防没有默认的索引文件设置
Options -Indexes
DirectoryIndex index.html index.php
注意:如果您必须加载第一个php索引文件,那么您必须设置
DirectoryIndex index.php index.html
它是?在测试服务器上试用,如果您有特定问题,请发回。是否可以修复index.html?不将其重定向到另一个域。