IM24LV Posted January 11, 2008 Report Share Posted January 11, 2008 Tātad lieta tāda, ka browseros ir paredzēts, ka kūkijus saglabā precīzi vienai lapai, un netiek atšķirts, ka abas īstenībā ir viena un tā pati lapa, tādēļ ir problēmas ar ielogošanos, ja tu esi ielogojies ar www.saite.lv un ja kautkur uzklikšķini uz bez tā www bet vienkaarshi saite.lv tad atkal par jaunu ir jaaielogojas, kaut tavs sesijas laiks veel nav izbeigts. nav ne jausmas kā varētu to atrast angļu valodā tāpēc prasu palīdzību zinošajiem. :) laikam ar htacces failu to var izdarīt? ja jā tad kā? Link to comment Share on other sites More sharing options...
andrisp Posted January 11, 2008 Report Share Posted January 11, 2008 Var arī $_SERVER['HTTP_HOST'] izmantot, lai ar PHP veiktu redirektu. Link to comment Share on other sites More sharing options...
Toms Posted January 11, 2008 Report Share Posted January 11, 2008 rewritecond %{http_host} ^www\.domens\.lv [nc] rewriterule ^(.*)$ http://domens.lv/$1 [r=301,nc] Link to comment Share on other sites More sharing options...
IM24LV Posted January 11, 2008 Author Report Share Posted January 11, 2008 hmm, Tom, Tavs kods ir .htaccess failam ? ja jā, tad kaut kas nesapas, varbū tas nav pilnais kods? :) Link to comment Share on other sites More sharing options...
Toms Posted January 11, 2008 Report Share Posted January 11, 2008 Tas ir .htaccess, bet uz dažādām konfigurācijām darbojās(jāpieraksta) mazliet dažādi viņš. Varbūt [nc] vietā ? Paeksperimentēt vajag. Link to comment Share on other sites More sharing options...
andrisp Posted January 11, 2008 Report Share Posted January 11, 2008 Varbūt nemaz htaccess faili nav enablēti. Link to comment Share on other sites More sharing options...
marcis Posted January 11, 2008 Report Share Posted January 11, 2008 Vismazāk problēmas būs ar andrisp ieteikto variantu. <? $url="saite.lv"; // tavas vietnes saite $uhost=$_SERVER['HTTP_HOST']; $uhost=str_replace("http://","",$uhost); if($uhost!=$url) header("Location: http://".$uhost); ?> Pieņemu, ka varētu strādāt :) Link to comment Share on other sites More sharing options...
IM24LV Posted January 11, 2008 Author Report Share Posted January 11, 2008 Nē, htacces darbojas. īsti nezinu kur meklēt konfigurāciju lai zinātu kādi burti tad tur īsti vajadzīgi. Link to comment Share on other sites More sharing options...
blackhalt Posted January 11, 2008 Report Share Posted January 11, 2008 mod_rewrite modulim jābūt. RewriteCond %{HTTP_HOST} !^bla.lv [NC] RewriteRule ^(.*)$ http://bla.lv%{REQUEST_URI} [R=301,L] Link to comment Share on other sites More sharing options...
black Posted January 11, 2008 Report Share Posted January 11, 2008 Elementāri, dārgo Vatson - pirms sesijas palaišanas palaid "ini_set('session.cookie_domain', ".site.lv");" Tad viena un tā pati sesija darbosies gan http://www.site.lv, gan http://site.lv, gan http://whatever.site.lv Link to comment Share on other sites More sharing options...
andrisp Posted January 11, 2008 Report Share Posted January 11, 2008 black, skaidri zini, ka darbosies arī uz http://site.lv ? Link to comment Share on other sites More sharing options...
black Posted January 11, 2008 Report Share Posted January 11, 2008 (edited) Esmu 99% pārliecināts par to. Edited January 28, 2008 by black Link to comment Share on other sites More sharing options...
IM24LV Posted January 11, 2008 Author Report Share Posted January 11, 2008 mod_rewrite modulim jābūt. RewriteCond %{HTTP_HOST} !^bla.lv [NC] RewriteRule ^(.*)$ http://bla.lv%{REQUEST_URI} [R=301,L] kur vinju enablot? :( es vinju meegjinaaju itkaa taja pashaa htacces failinjaa neablot, bet tas nestraadaaja :( RewriteEngine on kad tavu kodu palaizhu tad paraada shadu : Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, webmaster@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. Tātad - kur kas jāieraksta lai enablotu? :) Link to comment Share on other sites More sharing options...
Aleksejs Posted January 11, 2008 Report Share Posted January 11, 2008 iespējams, ka iekš: /etc/[apache[2]|httpd]/httpd.conf ir jāatkomentē/jāieraksta rindiņa: LoadModule rewrite_module modules/mod_rewrite.so http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html Link to comment Share on other sites More sharing options...
IM24LV Posted January 11, 2008 Author Report Share Posted January 11, 2008 Atkomentēju, bet nekā. modulis iekš moduļu mapes arī ir. :( Link to comment Share on other sites More sharing options...
Recommended Posts