Friends. How i can join my site in tow tabs www and http. If i am login my one ID in http tab and i try to online my 2nd ID in 2nd tab www then it is not login to my 2nd ID it is shown my 1 ID in tow tabs. What is it?
How i can join my site with tow IDs in one time. Example: www.johncms.com and 2nd tab
http://johncms.com ?
Topic in Russian.
if you want to join domain and subdomain www, you should do the following:
1 open .htaccess in your root folder with any editor
2 wright at any place (at the end f.e.)
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.your_site\.ru$ [NC]
RewriteRule ^(.*)$ http://your_site.ru/$1 [R=301,L]
Do not forget about \ (back slash) before . (dot) in the line RewriteCond it is obligatory.
seg0ro, Your code not working. I am going in
File: /public_html/.htaccess
and pasted there your code,
%{HTTP_HOST} ^www.my_site\.com$ [NC]
RewriteRule ^(.*)$ http://my_site.com/$1 [R=301,L]
but its not working. Supporting only one host http. Not www working.
Azhar-Ali, What error is displayed?
Simba, Sir not error. But if i am Login my ID Azhar Ali in http:// tab and visite with 2nd tab www then my ID will be Azhar Ali is automaticaly Logged. That is not right. We can tow id login in tow tabs ? But how it in johncms i dont know.
Azhar-Ali, search strings
setcookie("cuid", $cuid, time() + 3600 * 24 * 365);
setcookie("cups", $cups, time() + 3600 * 24 * 365);
in the file login.php
replace to
setcookie("cuid", $cuid, time() + 3600 * 24 * 365, "/", ".example.com");
setcookie("cups", $cups, time() + 3600 * 24 * 365, "/", ".example.com");
example.com replace to your site.
dot on begin - required.
It is better to set up an automatic redirect from www. to the address without www.
Insert to .htaccess the code
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
Simba, Sir i am Replace to your code in login.php line 70
setcookie("cuid", $cuid, time() 3600 * 24 * 365, "/", ".my_site.com");
setcookie("cups", $cups, time() 3600 * 24 * 365, "/", ".my_site.com");
and paste your 2nd Code in my /.htaccess file
%{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://my_site.com/$1 [R=301,L]
But dont working my www tab .
I am send you my site name in pm.