大网数据广告活动
网站运营与故障问答

Add an exception to Joomla's .htaccess rewrite rules to allow an Owncloud subdirectory

· 52CE 我爱测

i'm actually use Joomla in our website and i would like to add Owncloud. The .htaccess in the root let Joomla side works without trouble: RewriteEngine On RewriteCond %{REQUEST_URI} !^/Joomla3 RewriteRule ^(.*)$ Joomla3/$1 [L] Bu…

问题原文

原帖链接 · Ashkrimn · CC BY-SA 3.0

i'm actually use Joomla in our website and i would like to add Owncloud. The .htaccess in the root let Joomla side works without trouble:

RewriteEngine On 
RewriteCond %{REQUEST_URI} !^/Joomla3
RewriteRule ^(.*)$ Joomla3/$1 [L]

But if want to access the owncloud service, i get this error:

The requested URL /Joomla3/owncloud/ was not found on this server.

It seems the original rewrite works with the owncloud directory too. my host is composed by 1 root directory and the 2 subdirectory:

  • -root
  • --Joomla
  • --Owncloud

How can I set .htaccess to

  1. rewrite URL from my website (example.com) into www.example.com/Joomla
  2. access owncloud (without rewrite) in the directory www.example.com/owncloud

已采纳解答

原帖链接 · MrWhite · CC BY-SA 3.0

RewriteCond %{REQUEST_URI} !^/Joomla3
RewriteRule ^(.*)$ Joomla3/$1 [L]

What these directives do is... if the requested URL does not start "/Joomla3" then internally rewrite the request to the "Joomla3" folder.

What you need to do is add another condition to state that... if the requested URL does not start "/Joomla3" and it does not start "/owncloud" then internally rewrite the request to the "Joomla3" folder.

For example, this could be achieved by adding a second RewriteCond (condition) directive:

RewriteCond %{REQUEST_URI} !^/Joomla3
RewriteCond %{REQUEST_URI} !^/owncloud
RewriteRule ^(.*)$ Joomla3/$1 [L]

RewriteCond directives are implicitly AND'd.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2016-07-08)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。