问题原文
原帖链接 · 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
- rewrite URL from my website (example.com) into
www.example.com/Joomla - 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.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
