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

查看:25
本文介绍了在子目录中安装 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/subdir),但仍然从根访问它(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 和 log-folders
  • 将 .htaccess 文件添加到根文件夹:

(代码修改自这个极好的答案)

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天全站免登陆