Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter animalmutch

    (@animalmutch)

    Hi,

    Put this in your .htaccess to rewrite all urls to the www. version:

    <IfModule mod_rewrite.c>
       Options +FollowSymLinks
       Options +Indexes
       RewriteEngine On
       RewriteBase /
       RewriteCond %{HTTP_HOST} ^yourdomain\.com$
       RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [R=301,L]
    </IfModule>

    Thread Starter animalmutch

    (@animalmutch)

    Well, just in case it’s useful to anybody I’ll let you know how I fixed it in the end:

    The whole problem was down to the canonical domain set in the wordpress settings. I set a canonical domain via .htaccess and set the same canonical domain in wordpress et voila!

    Now I can happily use sessions just by starting the session in the normal way at the top of my theme template pages.

    This was also causing a ‘same-domain policy’ issue when trying to use ajax, but the canonical domain fixed this too.

    Can’t believe it’s taken me this long to work this out! I’m officially retarded.

    Thread Starter animalmutch

    (@animalmutch)

    I am now getting a session, but when I move between wordpress pages and pages in my static site, the session does not persist, and a new session is set up. When I go back to wordpress pages the previous session is still active on these pages! Any ideas?

    Thread Starter animalmutch

    (@animalmutch)

    PS – The weird thing is that this works perfectly on my local server. It’s only on the live version that sessions suddenly stop working, so it seems that there could be a server configuration issue, perhaps?

Viewing 4 replies - 1 through 4 (of 4 total)