Www 和非 www 站点
我有一个域名 http://www.testexample.com.当我登录 http://www.testexample.com 并返回 http://testexample.com 在浏览器中;不显示登录的用户信息.
我知道以上两者的处理方式不同,因此它不会保留 http://www.testexample.com 的会话 在访问 http://testexample.com 时.
I have a domain say http://www.testexample.com. When I login to http://www.testexample.com and come back to http://testexample.com in browser; the logged in user information is not displayed.
I know that the both of the above are treated differently and hence it is not retaining the session for http://www.testexample.com while accessing http://testexample.com.
如果 cakephp 有办法在 TLD 上进行匹配,请告诉我.因此,每当我输入 http://testexample.com 时,它都应该为 http://www.testexample.com
Please let me know if cakephp has a way to do a match on the TLD. So whenever I type http://testexample.com it should take session for http://www.testexample.com
我使用以下代码从一个 URL 重定向到另一个
I am using the following code to redirect from one URL to the other
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ps6309 [NC]
RewriteRule ps6309.domain.co.in [L,R=301]
这是在我的本地测试机器上.这有时有效,有时无效.
此外,我已将 rewritelog 指令添加到我的 httpd.conf 文件中.但是日志文件没有得到更新.如果有人对此有任何指示,请告诉我.
this is on my local test machine. This works sometimes and sometimes doesn't.
Also I have added the rewritelog directive to my httpd.conf file.
But the log file is not getting updated.
Please let me know if anyone has any pointers to this.
推荐答案
使用 .htaccess 重定向所有 http://domain.com -> http://www.domain.com
Use .htaccess to redirect all http://domain.com -> http://www.domain.com
RewriteCond %{HTTP_HOST} !^www.domain.com
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=permanent,L]
相关文章