在子目录中安装Joomla [英] Install Joomla in a subdirectory

查看:123
本文介绍了在子目录中安装Joomla的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您可能已经知道,Wordpress的设置中有一个选项可以将站点安装在子目录中,同时以站点URL为主要域.它类似于网站网址"和"WordPress网址".我正在Joomla中寻找类似的东西.我知道没有内置选项,但是我宁愿不必移动所有文件(如果可能).并且,请像五岁的孩子一样向我解释一下,以防万一:)

As some of you may know, Wordpress has an options in settings to allow site installation in a subdirectory, while having the site URL be the main domain. It was something like "Site url" and "Wordpress url". I'm looking for something like this in Joomla. I know there is no inbuilt option for it, but I'd rather not have to move all the files if possible. And please, explain it to me like to a five year old, just in case :)

推荐答案

要将整个joomla安装移至服务器上的子文件夹( http://example .com ),我做了以下操作:

To move the whole joomla installation to a subfolder on the server (http://example.com/subdir), but still access it from the root (http://example.com) I did the following:

  • 将整个安装移至子目录文件夹
  • 在configuration.php中,设置$ live_site =" http://example.com ";
  • 还可以在configuration.php中更改tmp和日志文件夹
  • 将.htaccess文件添加到根文件夹:
  • Move your whole installation to the subdir-folder
  • In configuration.php, set $live_site = "http://example.com";
  • Also change the tmp and log-folders in configuration.php
  • Add a .htaccess-file to the root-folder:

(该代码是从这个出色的答案修改而成的)

(The code is modified from this excellent answer)

RewriteEngine on
RewriteCond %{THE_REQUEST} subdir/
RewriteRule ^subdir/(.*) http://example.com/$1 [R=301,L]
RewriteCond %{REQUEST_URI} !subdir/
RewriteRule ^(.*)$ /subdir/$1 [L]

修改默认的joomla .htaccess文件,该文件现在位于/subdir-folder中,以包括RewriteBase:

Modify the default joomla .htaccess-file, now in the /subdir-folder, to include a RewriteBase:

RewriteBase /subdir/

在进行了这些修改之后,似乎一切都按照应有的方式运行.

After these modifications it seems everything works the way it should.

这篇关于在子目录中安装Joomla的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆