3

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
2
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.

  • It works (for the installation part!) After that trying to access to ../owncloud, i get only "input file not specified". i guess it cannot find the right index.php file and stop processing. – Ashkrimn Jul 9 '16 at 10:28
  • 1
    update: the trick was to set cgi.fix_pathinfo = 1 in php.ini configuration. now it works! :) – Ashkrimn Jul 9 '16 at 10:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.