Home >Backend Development >PHP Tutorial >htaccess守则修改!

htaccess守则修改!

WBOY
WBOYOriginal
2016-06-13 12:03:29919browse

htaccess规则修改!急!!!!!
RewriteCond Host: (.*)\.olddomain\.com
RewriteRule (.*) http\://$1\.newdomainf\.com$2 [I,RP]

以上的是ISAPI_Rewrite2的规则!上面实现的换域名功能!


求把以上规则改成符合.htaccess的!谢谢 
------解决方案--------------------
大致是这样,未经测试
RewriteCond %{HTTP_HOST} ^([^\.]+).olddomain.com$
RewriteRule ^(.*)$ http://%1.newdomainf\.com/$1 [R=301,L]

------解决方案--------------------

引用:
大致是这样,未经测试
RewriteCond %{HTTP_HOST} ^([^\.]+).olddomain.com$
RewriteRule ^(.*)$ http://%1.newdomainf\.com/$1 [R=301,L]


这个应该可以了
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn