代码之家  ›  专栏  ›  技术社区  ›  Peter

无法将Joomla文章以正确的URL打开

  •  0
  • Peter  · 技术社区  · 6 年前

    问题: 我的文章有正确的网址:例如newsite.com/article。但是,通过单击一篇文章,我得到一篇空文章。我可以看到我的侧边栏。

    我将joomla安装程序移到了服务器中的另一个文件夹中。 我要将我的域从oldsite.com更改为newsite.com。

    我不确定是否需要更改 数据库 或者不是。

    我最近 配置.php 从oldsite.com移动到newsite.com。

    <?php
    class JConfig {
    var $offline = '1';
    var $editor = 'jce';
    var $list_limit = '20';
    var $helpurl = 'http://help.joomla.org';
    var $debug = '0';
    var $debug_lang = '0';
    var $sef = '1';
    var $sef_rewrite = '1';
    var $sef_suffix = '0';
    var $feed_limit = '10';
    var $secret = '----------------';
    var $gzip = '0';
    var $error_reporting = '7';
    var $xmlrpc_server = '0';
    var $log_path = '/home/masi/public_html/NewSite/logs';        // I added this
    var $tmp_path = '/home/masi/public_html/NewSite/tmp';         // I added this
    var $live_site = 'http://www.NewSite.com/';                   // I added this
    var $offset = '0';
    var $caching = '0';
    var $cachetime = '15';
    var $cache_handler = 'file';
    var $memcache_settings = array();
    var $ftp_enable = '0';
    var $ftp_host = '127.0.0.1';
    var $ftp_port = '21';
    var $ftp_user = 'admin';
    var $ftp_pass = '------------';              // hidden now for security
    var $ftp_root = '';
    var $dbtype = 'mysql';
    var $host = 'localhost';
    var $user = 'masi_jml02';                   
    var $db = 'masi_jml02';                      
    var $dbprefix = '';
    var $mailer = 'mail';
    var $mailfrom = 'admin@masi.com';          
    var $fromname = '';
    var $sendmail = '/usr/sbin/sendmail';
    var $smtpauth = '1';
    var $smtpuser = '';
    var $smtppass = '';
    var $smtphost = 'localhost';
    var $MetaAuthor = '0';
    var $MetaTitle = '1';
    var $lifetime = '15';
    var $session_handler = 'database';
    var $password = '--------------';                   // hidden now for security
    var $sitename = '--------------';                   // hidden now for security
    var $MetaDesc = '';
    var $MetaKeys = '';
    var $offline_message = 'This site is down for maintenance. Please check back again soon.';
    }
    ?>
    

    我在上面的代码中添加注释,以指示在移动安装文件夹后更改的行。

    我的 索引文件 在公共网站上\html/newsite/templates/theme/

    <?php
    
    // no direct access
    defined( '_JEXEC' ) or die( 'Restricted access' );
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" >
    <head>
    <jdoc:include type="head" />
    <link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/system.css" type="text/css" />
    <link rel="stylesheet" href="<?php echo $this->baseurl;?>/templates/system/css/general.css" type="text/css" />
    
    <link rel="stylesheet" href="<?php echo $this->baseurl;?>/templates/<?php echo $this->template ?>/css/customize.css" type="text/css" />
    
    
    <script type="text/javascript" src="<?php echo $this->baseurl;?>/templates/<?php echo $this->template ?>/js/global.js"></script>
    <?php if($this->countModules('left') <= 0 ) : ?>
    
    <?php endif; ?>
    <?php $div_wrap = ($this->countModules('left')) ? 'modulewrap' : 'modulewrap_wide'; ?>
    <?php $div_right = ($this->countModules('user4')) ? 'right' : 'right_wide'; ?>
    <?php $div_left = ($this->countModules('right')) ? 'left' : 'left_wide'; ?>
    </head><body>
    <div id="outerwrap">
    
      <div id="header">
    
        <?php if($this->countModules('user1')) : ?>
        <jdoc:include type="modules" name="user1" style="xhtml" />
        <?php else: ?>
        <h1><a href="<?php echo $mainframe->getCfg('live_site');?>" title="<?php echo $mainframe->getCfg('sitename');?>"><?php echo $mainframe->getCfg('sitename');?></a></h1>
        <?php endif; ?>
    
      </div>
    
    <!-- 3bar column -->
          <?php if ($this->countModules('top')): ?>
          <div id="top">
          <jdoc:include type="modules" name="top" style="xhtml" />
          </div>
          <?php endif; ?>
    <!-- End 3bar column -->
      <div class="clear"></div>
      <div id="wrapper">
    
    
      <!-- Start leftcol -->
        <?php if($this->countModules('left')) : ?>
        <div id="leftcol">
          <jdoc:include type="modules" name="left" style="xhtml" />
        </div>
        <!-- END leftcol -->
        <?php endif; ?>
    
    <!-- Right column -->
          <?php if ($this->countModules('user3')): ?>
          <div id="user3">
          <jdoc:include type="modules" name="user3" style="xhtml" />
          </div>
          <?php endif; ?>
    <!-- End Right column -->
    
        <div id="mainbody">
          <div class="inside">
            <jdoc:include type="message" />
            <jdoc:include type="component" />
    </div>
          <!-- END INSIDE -->
        </div>
        <!-- END MAINBODY -->
    
    
          <div class="clear"></div>
        </div>
        <!--END WRAP-->
      </div>
      <!--END WRAPPER-->
      <div class="clear"></div>
      <div id="bottombar"></div>
    </div>
    <!--END OUTERWRAP-->
    
    <div class="designer">
    <jdoc:include type="modules" name="footer" style="raw" /></div>
    
    
    </body>
    </html>
    
    3 回复  |  直到 6 年前
        1
  •  2
  •   markus    16 年前

    好啊。。。

    • 你把整个安装移到了一个新目录?子目录?
    • “没有正确打开”是什么意思?请提供错误消息或链接!
    • 您调整了configuration.php!你能把它贴在这里吗(取出密码)
    • 它绝对可以在数据库中不做任何事情的情况下工作。
    • 是否确定configuration.php中的更改已生效。例如,文件不可写,或者您脱机编辑了它,但忘记上载它…
    • 您是否干预了模板的index.php?也许URL是硬编码的?
    • 是否有其他需要重新调整/重新配置的组件/模块/插件?
        2
  •  0
  •   Léo Léopold Hertz 준영    16 年前

    我的网站被配置为使用mod_rewrite,但没有.htaccess文件可用。

    我禁用了mod ou重写,链接现在可以工作了。

        3
  •  0
  •   Egeshi    12 年前

    如果新网站位于Web服务器根目录下的子文件夹中,只需检查 RewriteBase .htaccess文件中的指令。更新 RewriteBase / RewriteBase /subfolder/ 正如我所看到的,你的网站的根很可能是 public_html 实际网站位于的目录 NewSite 目录。所以试着替换 改写库 RewriteBase /NewSite/ (尾随斜线是必需的)。