kukipei Posted January 3, 2010 Share Posted January 3, 2010 Hi to all, I have some strange problem. I am using this .htaccess file Options +FollowSymLinks RewriteEngine On DirectoryIndex mvm.php ErrorDocument 404 /mvm.php RewriteRule ^chessdatabase/$ /mvm.php [L] RewriteRule ^searchposition/(.*)/$ /search-database-position.php?fen=$1 [L] RewriteRule ^([0-9]+)/searchposition/(.*)/$ /search-database-position.php?fen=$2&page=$1 [L] RewriteRule ^chessgame/(.*)/(.*)/([0-9]+)/$ /chessgame.php?gameid=$3 [L] RewriteRule ^onlinechessdatabase/$ /search-form.php [L] RewriteRule ^onlinechessdatabase/([0-9]+)/$ /search-form.php?page=$1 [L] # If requested resource does not exist as a file RewriteCond %{REQUEST_FILENAME} !-f # and does not end with a period followed by a filetype RewriteCond %{REQUEST_URI} !\..+$ # and does not end with a slash RewriteCond %{REQUEST_URI} !^(.*)/$ # then add a trailing slash and redirect RewriteRule ^(.*)$ http://www.gensunasumus.com/$1/ [L,R=301] Problem is that when I use some rewrite rule php does not send session to page. For example when I come to: http://www.gensunasumus.com/chessdatabase/ PHP does not send session, But when I use http://www.gensunasumus.com/mvm.php everything is OK. What can be a problem? Hope you understand my problem. Thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/187013-php-htaccess-and-session-problem/ Share on other sites More sharing options...
cags Posted January 3, 2010 Share Posted January 3, 2010 I can't personally see how the .htaccess could possibly effect whether your page is part of a session. I could potentially understand if you were masking another URL as the cookie would be registered against a different domain, but in this case your obviously not. Since sessions are handled by PHP if you are arriving at the right page it should be part of the session. Do you have session_start() at the top of all the pages you wish to be part of the session? The only thing I can suggest trying is checking your Cookies under both situations and see if there is any difference for the SESSIONID. The web developer toolbar for Firefox is pretty handy for this. On a side note, using frames with IE can affect sessions, but I don't see how this will relate in your case. Quote Link to comment https://forums.phpfreaks.com/topic/187013-php-htaccess-and-session-problem/#findComment-987622 Share on other sites More sharing options...
PFMaBiSmAd Posted January 3, 2010 Share Posted January 3, 2010 What does a phpinfo() statement show for the session.cookie_path setting? Quote Link to comment https://forums.phpfreaks.com/topic/187013-php-htaccess-and-session-problem/#findComment-987624 Share on other sites More sharing options...
kukipei Posted January 3, 2010 Author Share Posted January 3, 2010 Thanks for anwering, I am using session_start() and I don't see any difference for the SESSIONID. This .htaccess file works well on my local but when I upload it on my site it doesn't work. session.cookie_path from phpinfo() is: / Quote Link to comment https://forums.phpfreaks.com/topic/187013-php-htaccess-and-session-problem/#findComment-987627 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.