News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Problem redirecting to subdirectory

Started by Krashsite, May 12, 2016, 01:43:22 AM

Previous topic - Next topic

Sir Osis of Liver

  Trying to redirect all variants of domain/subdirectory to subdirectory using .htaccess -



RewriteEngine On
RewriteRule ^$ /forum [L]




www.domain.com - works
domain.com - works
www.domain.com/forum - works
domain.com/forum - doesn't work in IE11

In IE11, login attempt results in SMF error 'You were unable to login. Please check your cookie settings.'  If second tab is opened, am logged into forum.  Login is normal in FF.  Also happens using php header redirect in account root. 

Any idea what's causing this?

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

qc

Is it about the "www" subdomain - or was that just an example and your real subdomain contains an underscore "_"? IE doesn't like that...

Edit: Probably rather related to this: http://stackoverflow.com/questions/15115917/ie10-sharing-cookies-across-subdomains-by-default
Playing quizduell? Having quizduell questions? Our german quizduell forum quizcommunity.de is looking for quiz freaks to come and play quizduell with us :)

Sir Osis of Liver

It's not a subdomain, forum is installed in /forum subdirectory, only letters in url.  I'm redirecting all traffic to the domain (www.domain.com) to the subdirectory (www.domain.com/forum).  The redirect is successful in all cases, but domain.com/forum results in SMF cookie error in IE.  The login is actually successful, if I open another tab and go to the forum, I'm logged in.  It seems to be an SMF problem.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Arantor

Try turning on subdomain independent cookies.

SMF's idea of 'subdomain dependent' cookies also forces them to be bound to the relevant path in the domain too. If a browser chooses to do something odd with it, that's something else.

Though if you're redirecting from / to /forum why not just install it in / to begin with?

Sir Osis of Liver

Hmm, thought I had tried that, but it seems to have fixed it.  Both links without www. were causing login problem today, but all variants are working now.  IE works in mysterious ways.

Don't like to install forum in root in case owner decides to add something else to the account (website, blog, etc.).  It's a new setup, just the forum for now, but saves me the trouble of having to move at some later point.

Thx, Arantor.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Arantor


Advertisement: