PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Don't mix WWW and without!

Common Questions/Problems/Tips. Posted by Administrators & Support Reps.

Don't mix WWW and without!

Postby Jason Caldwell » October 24th, 2010, 3:02 am

Some site owners don't realize that ALL browsers consider variations in your domain as "different". That is, EVERY browser sees each of these URLs as totally different destinations:
Code: Select all
http://example.com/
http://www.example.com/
For this reason, most site owners implement .htaccess tricks to force one version or the other, so that a visitor could type either into their address bar, yet still end up in the right place.

Concerning the s2Member plugin for WordPress®:

If a Member logs in at: ( NOTICE the www. prefix )
Code: Select all
http://www.example.com/wp-login.php
their login Cookie will ONLY be recognized on that particular variation of your site.

Now, if you created a link to: ( WITHOUT the www. prefix )
Code: Select all
http://example.com/category/juices/
they would NOT be recognized as a logged-in Member, because they originally logged in on another variation of your domain ( with the www. prefix ).

Decide which variation you're going to use:
Decide early-on which domain variation you're going to use, and make sure that your installation of WordPress® is configured to match what you intend to use. Check your Dashboard under: Settings -> General. All of the URLs configured in that panel, need to match what you intend to use.

Remain consistent: Be consistent in the way you link to pages on your site. Please do NOT create links on your site that use different variations of your domain. That could result in a visitor logging in on one variation, but clicking links on your site that land them on another variation ( where they may not be recognized as a logged-in Member ).

Related articles:
http://blog.stackoverflow.com/2008/06/d ... ww-prefix/
http://www.codinghorror.com/blog/2008/0 ... ebate.html
http://www.besthostratings.com/articles ... ccess.html
http://codex.wordpress.org/Changing_The_Site_URL

Forcing one or the other:
http://www.besthostratings.com/articles ... ccess.html
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Don't mix WWW and without!

Postby chelle » October 29th, 2010, 10:50 pm

Yes, everyone needs to read this first thing before they install s2member- I learned this the hard way...and probably am why you posted this :)
User avatar
chelle
Registered User
Registered User
 
Posts: 41
Joined: September 6, 2010

Re: Don't mix WWW and without!

Postby PorridgePot » November 24th, 2010, 9:10 am

same here. I spent a couple hours trying to figure out what was wrong.
User avatar
PorridgePot
Registered User
Registered User
 
Posts: 8
Joined: November 19, 2010

Re: Don't mix WWW and without!

Postby cdvrooman » January 8th, 2011, 3:17 pm

How would you handle support for HTTPS?

For example, redirecting https://example.com to https://www.example.com?
User avatar
cdvrooman
Registered User
Registered User
 
Posts: 6
Joined: December 21, 2010

Re: Don't mix WWW and without!

Postby Jason Caldwell » January 13th, 2011, 6:12 am

cdvrooman wrote:How would you handle support for HTTPS?

For example, redirecting https://example.com to https://www.example.com?

You might take a look here:
http://www.askapache.com/htaccess/ssl-e ... ccess.html
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Don't mix WWW and without!

Postby james » January 26th, 2011, 5:24 pm

Yup we've have all urls with www striped. Also, everyone should remember to set this in you google webmaster tools.

thanks
User avatar
james
Registered User
Registered User
 
Posts: 9
Joined: January 13, 2011

Re: Don't mix WWW and without!

Postby ThePick » February 13th, 2011, 1:20 am

Great post, Jason. I just spent a couple of hours ripping my hair out over this little issue and managed to figure out what the problem was after a lot of trial and error. It sure felt good when my Welcome Page finally popped up again after logging in.
User avatar
ThePick
Registered User
Registered User
 
Posts: 4
Joined: January 22, 2011

Re: Don't mix WWW and without!

Postby musickjl » August 8th, 2011, 4:41 pm

Is there a good way to fix this problem? Since multi site automatically creates the subdomain without the www I now have hundreds of links that take me back to the login screen. Please help!
User avatar
musickjl
Registered User
Registered User
 
Posts: 4
Joined: August 8, 2011

Re: Don't mix WWW and without!

Postby Jason Caldwell » August 8th, 2011, 11:56 pm

This post would normally NOT apply to a Multisite Network when you're running in sub-domain mode. When a Multisite Network is running with sub-domains, cookies are set for each sub-domain respectively, and the www issue is only relevant on the Main Site of the Network.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Don't mix WWW and without!

Postby musickjl » August 9th, 2011, 9:13 am

That's correct, and I am only having issues with it on the main site. My problem is that I don't even need S2Member on my main site, only the subsite. Is there anyway to disable the plugin on the main site and only have it work on the subsite? This would solve my proglem. Thanks for your help!
User avatar
musickjl
Registered User
Registered User
 
Posts: 4
Joined: August 8, 2011

Re: Don't mix WWW and without!

Postby Cristián Lávaque » August 9th, 2011, 1:35 pm

Just don't use in the main site, no restrictions, no buttons. Or do you mean not have it even active, or not showing in the plugins?
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Don't mix WWW and without!

Postby musickjl » August 9th, 2011, 1:50 pm

Correct, not having it as an active plugin on the main site, just the subsite. Thanks,
User avatar
musickjl
Registered User
Registered User
 
Posts: 4
Joined: August 8, 2011

Re: Don't mix WWW and without!

Postby Jason Caldwell » August 9th, 2011, 9:08 pm

Excellent question. Thank you.
musickjl wrote:Correct, not having it as an active plugin on the main site, just the subsite. Thanks,
Unfortunately, a default installation of WordPress does not provide that ability in Multisite mode. However, one of these plugins may help you accomplish what you need to.

http://wordpress.org/extend/plugins/plugins-enabler/
http://wordpress.org/extend/plugins/exclude-plugins/
http://wordpress.org/extend/plugins/res ... e-plugins/
http://wordpress.org/extend/plugins/plu ... -networks/
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Don't mix WWW and without!

Postby duncanmajor » January 13th, 2012, 9:17 am

Thanks for this thread. In my case, adding www solved an error with my custom value domain name.
User avatar
duncanmajor
Registered User
Registered User
 
Posts: 2
Joined: January 5, 2012


Return to Common Questions/Problems/Tips

Who is online

Users browsing this forum: No registered users and 1 guest