We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5010
    • 14 Posts
    Привет. У меня сайт доступен в виде http://velostars.ru/
    Если зайти на http://www.velostars.ru/ то он отображается, но тумбы новостей не отображаются. и все ссылки ведут на страницы без www.

    Как сделать так, чтобы корректно отображалось и с www и без?
      www.cheerful.ru
      www.1two.ru - Личный блог Миши Чирфула
      • 28630
      • 31 Posts
      Установить
      <base href="http://site.ru/" /> 


      А ссылки на ресурсы делать относительными.
      К примеру.
      <link rel="stylesheet" href="css/960.css" type="text/css" media="screen" /> 
      <script src="js/jquery-1.3.2.min.js" type="text/javascript"></script>
      
        • 785
        • 2,113 Posts
        Плохое решение. Правильно будет выбрать основной вариант а для второго задать редирект в .htaccess, указав нужное имя :

        RewriteCond %{HTTP_HOST} .
        RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
        RewriteRule (.*) http://www.example.com/$1 [R=301,L]

        Или

        RewriteCond %{HTTP_HOST} .
        RewriteCond %{HTTP_HOST} !^example\.com [NC]
        RewriteRule (.*) http://example.com/$1 [R=301,L]
          Создание сайтов на MODx, поддержка сайтов, поисковая оптимизация, программирование, копирайтинг
          Статьи о MODx, регулярно новые публикации
          • 5010
          • 14 Posts
          Quote from: AKots at Dec 19, 2009, 10:00 AM

          Плохое решение. Правильно будет выбрать основной вариант а для второго задать редирект в .htaccess, указав нужное имя :

          RewriteCond %{HTTP_HOST} .
          RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
          RewriteRule (.*) http://www.example.com/$1 [R=301,L]

          Или

          RewriteCond %{HTTP_HOST} .
          RewriteCond %{HTTP_HOST} !^example\.com [NC]
          RewriteRule (.*) http://example.com/$1 [R=301,L]


          воспользовался вашим вариантом. всё работает в мозиле и эксплорере. А вот Хром почему то скачивает какой то файл, вместо того, чтобы перенаправить на путь истинный))
          Я сделал чтобы с http://www перенаправлял на http://

          Что делать с хромом? huh
            www.cheerful.ru
            www.1two.ru - Личный блог Миши Чирфула
            • 5010
            • 14 Posts
            открыл блокнотом файл, который он скачивает и вот что там -
            <?php
            /*
            *************************************************************************
            	MODx Content Management System and PHP Application Framework 
            	Managed and maintained by Raymond Irving, Ryan Thrash and the
            	MODx community
            *************************************************************************
            	MODx is an opensource PHP/MySQL content management system and content
            	management framework that is flexible, adaptable, supports XHTML/CSS
            	layouts, and works with most web browsers, including Safari.
            
            	MODx is distributed under the GNU General Public License	
            *************************************************************************
            
            	MODx CMS and Application Framework ("MODx")
            	Copyright 2005 and forever thereafter by Raymond Irving & Ryan Thrash.
            	All rights reserved.
            
            	This file and all related or dependant files distributed with this filie
            	are considered as a whole to make up MODx.
            
            	MODx is free software; you can redistribute it and/or modify
            	it under the terms of the GNU General Public License as published by
            	the Free Software Foundation; either version 2 of the License, or
            	(at your option) any later version.
            
            	MODx is distributed in the hope that it will be useful,
            	but WITHOUT ANY WARRANTY; without even the implied warranty of
            	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
            	GNU General Public License for more details.
            
            	You should have received a copy of the GNU General Public License
            	along with MODx (located in "/assets/docs/"); if not, write to the Free Software
            	Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
            
            	For more information on MODx please visit http://modxcms.com/
            	
            **************************************************************************
                Originally based on Etomite by Alex Butter
            **************************************************************************
            */	
            
            /**
             * Initialize Document Parsing
             * -----------------------------
             */
            
            // get start time
            $mtime = microtime(); $mtime = explode(" ",$mtime); $mtime = $mtime[1] + $mtime[0]; $tstart = $mtime;
            
            // harden it
            require_once(dirname(__FILE__).'/manager/includes/protect.inc.php');
            
            // set some settings, and address some IE issues
            @ini_set('url_rewriter.tags', '');
            @ini_set('session.use_trans_sid', 0);
            @ini_set('session.use_only_cookies',1);
            session_cache_limiter('');
            header('P3P: CP="NOI NID ADMa OUR IND UNI COM NAV"'); // header for weird cookie stuff. Blame IE.
            header('Cache-Control: private, must-revalidate');
            ob_start();
            error_reporting(E_ALL & ~E_NOTICE);
            
            /**
             *	Filename: index.php
             *	Function: This file loads and executes the parser. *
             */
            
            define("IN_ETOMITE_PARSER", "true"); // provides compatibility with etomite 0.6 and maybe later versions
            define("IN_PARSER_MODE", "true");
            define("IN_MANAGER_MODE", "false");
            
            if (!defined('MODX_API_MODE')) {
                define('MODX_API_MODE', false);
            }
            
            // initialize the variables prior to grabbing the config file
            $database_type = '';
            $database_server = '';
            $database_user = '';
            $database_password = '';
            $dbase = '';
            $table_prefix = '';
            $base_url = '';
            $base_path = '';
            
            // get the required includes
            if($database_user=="") {
            	$rt = @include_once(dirname(__FILE__).'/manager/includes/config.inc.php');
            	// Be sure config.inc.php is there and that it contains some important values
            	if(!$rt || !$database_type || !$database_server || !$database_user || !$dbase) {
            	echo "
            <style type=\"text/css\">
            *{margin:0;padding:0}
            body{margin:50px;background:#eee;}
            .install{padding:10px;border:5px solid #f22;background:#f99;margin:0 auto;font:120%/1em serif;text-align:center;}
            p{ margin:20px 0; }
            a{font-size:200%;color:#f22;text-decoration:underline;margin-top: 30px;padding: 5px;}
            </style>
            <div class=\"install\">
            <p>MODx is not currently installed or the configuration file cannot be found.</p>
            <p>Do you want to <a href=\"install/index.php\">install now</a>?</p>
            </div>";
            		exit;
            	}
            }
            
            // start session 
            startCMSSession();
            
            // initiate a new document parser
            include_once(MODX_MANAGER_PATH.'/includes/document.parser.class.inc.php');
            $modx = new DocumentParser;
            $etomite = &$modx; // for backward compatibility
            
            // set some parser options
            $modx->minParserPasses = 1; // min number of parser recursive loops or passes
            $modx->maxParserPasses = 10; // max number of parser recursive loops or passes
            $modx->dumpSQL = false;
            $modx->dumpSnippets = false; // feed the parser the execution start time
            $modx->tstart = $tstart;
            
            // Debugging mode:
            $modx->stopOnNotice = false;
            
            // Don't show PHP errors to the public
            if(!isset($_SESSION['mgrValidated']) || !$_SESSION['mgrValidated']) {
                @ini_set("display_errors","0");
            }
            
            // execute the parser if index.php was not included
            if (!MODX_API_MODE) {
                $modx->executeParser();
            }
            ?>
              www.cheerful.ru
              www.1two.ru - Личный блог Миши Чирфула
              • 785
              • 2,113 Posts
              Это файл index.php, он должен выполняться на сервере, а не передаваться, и вообще-то от браузера это не должно зависеть. Что-то не так настроено на сервере, а может быть случайно что-то испортили в настройках, когда правили .htaccess.
                Создание сайтов на MODx, поддержка сайтов, поисковая оптимизация, программирование, копирайтинг
                Статьи о MODx, регулярно новые публикации
                • 5010
                • 14 Posts
                Quote from: AKots at Dec 20, 2009, 09:51 AM

                Это файл index.php, он должен выполняться на сервере, а не передаваться, и вообще-то от браузера это не должно зависеть. Что-то не так настроено на сервере, а может быть случайно что-то испортили в настройках, когда правили .htaccess.

                да, видимо что-то напортачил. вставил из исходника и теперь все работает)
                спасибо большое smiley
                  www.cheerful.ru
                  www.1two.ru - Личный блог Миши Чирфула
                • what about this?


                  Options +FollowSymLinks
                  RewriteEngine on
                  RewriteCond %{HTTP_HOST} ^some.bg [NC]
                  RewriteRule ^(.*)$ http://www.some.bg/$1 [L,R=301]
                    palma non sine pulvere