繁体   English   中英

htaccess 文件中的域重定向

[英]domain redirection in htaccess file

我想将我的域登陆页面重定向到其他域,但我不想在域登陆页面之后重定向所有内容。任何人都可以帮助我如何做到这一点。 我的 htaccess 文件:-

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

RewriteCond %{HTTP_HOST} ^women\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.women\.com$
RewriteRule ^/?$ "http\:\/\/beta\.women\.com\/" [R=301,L]

我想women.com登陆页面重定向到beta.women.comwomen.com?post_type=in_product&p=509&preview=1或women.com/about或一切women.com/之后不重定向到beta.women.com

任何帮助将不胜感激!

谢谢 !

在其他规则之前保留重定向规则,并使用RewriteCond从重定向中排除任何查询字符串:

RewriteEngine On
RewriteBase /

RewriteCond %{QUERY_STRING} ^$
RewriteCond %{HTTP_HOST} ^(?:www\.)?(women\.com)$ [NC]
RewriteRule ^/?$ http://beta.%1/ [R=301,L]

RewriteRule ^index\.php$ - [L,NC]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM