【发布时间】:2017-06-20 14:53:16
【问题描述】:
我想将example.com/test 重定向到www.example.com/test 和example.com/contact 到www.example.com/contact。
网络的所有路线也是如此。
我找到的所有东西,它所做的都是将example.com/test 重定向到www.example.com
以下是我的代码,我尝试过的所有方法都发生在我身上。他们工作正常,但他们没有做我想做的事。
RewriteCond %{HTTP_HOST} ^example.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
请有任何建议。 谢谢!
【问题讨论】:
标签: php .htaccess redirect mod-rewrite no-www