我环顾四周,似乎没有人遇到与我一样的问题。如何强制www。与.htaccess?
我用:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yoursite.com [NC]
RewriteRule ^(.*)$ http://www.yoursite.com/$1 [R=301,L]
然而,当我浏览到yoursite.com
我得到采取www.yoursite.com/public_html
不存在。
这里是我的目录结构:
/
| .htaccess
|
| public_html
|
|index.php
这工作完美,谢谢。 – joshkrz