.htaccess Htaccess重定向-www到添加了文件夹结构的子域
我正在寻找重定向属性列表到一个新的子域和域结构。例如,我想重定向.htaccess Htaccess重定向-www到添加了文件夹结构的子域,.htaccess,redirect,subdomain,.htaccess,Redirect,Subdomain,我正在寻找重定向属性列表到一个新的子域和域结构。例如,我想重定向 http://www.example.com/idx/details.php?thenALongString... 到 任何帮助都将不胜感激 我认为这应该行得通: RewriteEngine On RewriteCond %{HTTP_HOST} ^www.example.com$ [NC] RewriteRule ^idx/details.php http://mls.example.com/idx/3494/details.
http://www.example.com/idx/details.php?thenALongString...
到
任何帮助都将不胜感激 我认为这应该行得通:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]
RewriteRule ^idx/details.php http://mls.example.com/idx/3494/details.php [R=301,L]
我能弄明白。我使用了以下方法:
RedirectMatch 301/idx/details.php(.*)http://mls.lisasellspontevedra.com/idx/3494/details.php
旧URL上的动态字符串将转移到新位置的末尾。谢谢@Teun。添加时,它重定向到右子域,但它保留了动态结束字符串。所以重定向看起来是这样的:有没有一种方法可以有一个动态的结尾。我的示例在details.php(?idxID=003&listingID=607267)之后有这样的内容。正如您所看到的,清单id可能非常不同。。我更新了我的答案,我希望它能工作(我现在无法自己测试)。
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]
RewriteRule ^idx/details.php http://mls.example.com/idx/3494/details.php [R=301,L]