Www和非www网站

编程入门 行业动态 更新时间:2024-10-19 12:40:56
本文介绍了Www和非www网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个域名 www.testexample 。当我登录到 www.testexample 时,返回 testexample ;将不显示登录的用户信息。 我知道上述两者都有不同的处理,因此它不保留 www.testexample 访问 testexample a>。

I have a domain say www.testexample. When I login to www.testexample and come back to testexample 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 www.testexample while accessing testexample.

请让我知道cakephp是否有办法在TLD上做匹配。因此,每当我输入 testexample 时,都应该为 www.testexample

Please let me know if cakephp has a way to do a match on the TLD. So whenever I type testexample it should take session for www.testexample

我使用以下代码从一个网址重定向到其他

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 - > www.domain

Use .htaccess to redirect all domain -> www.domain

RewriteCond %{HTTP_HOST} !^www\.domain\ RewriteRule ^(.*)$ www.domain/$1 [R=permanent,L]

更多推荐

Www和非www网站

本文发布于:2023-11-01 12:48:42,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1549377.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:网站   Www   www

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!