I’ve seen this topic of removing index.php from Nextcloud address discussed in a few older [and now closed] threads already, but I don’t seem to be able to find a solid and final solution anywhere. That is why I’m posting this question again, despite it being discussed before. Is there an actual solution for this?
The relevant information:
Nextcloud version (12.0.0):
Operating system and version (CentOS 6):
Apache or nginx version (Apache 2.2.32):
PHP version (7.0.12):
I can also tel you that as far as I can see in my .htaccess, mod_env and mod_rewrite seem to be enabled. And I use a shared host at the moment [Bluehost]. And FastCGI is enabled.
I have added 'htaccess.RewriteBase' => '/' to config.php, and I’m sure both modules are enabled.
However using a shared host I do not have sudo rights. What should my .htaccess look like after this?
Oh haha I just figured it out! It was in fact the bloody FastCGI… mod_php isn’t actually enabled when using FastCGI. I switched to php.ini and problem solved.
I’ve seen this question several times around the web, I hope someone else can use this.
I’m not sure if it is the right way to do it. But, I have added the below lines in the nextcloud.conf file under <Directory /var/www/nextcloud/> apart from occ update command
i also removed the lines for Action, Alias, and FastCgiExternalServer regarding the former php7-fcgi handler as they were no longer used.
and voila! the variablenames set via SetEnv in .htaccess stay unchanged, nextcloud recognises the front_controller_active variable -> /index.php/ is gone, without setting htaccess.IgnoreFrontController
@clouduser adding the line to my config.php and updating the htaccess worked for me. I didn’t even need to restart the server (I can’t anyway because I am on web hosting). Cheers!
Since you are also a web user, could you explicitly name all of the steps that you have gone through? Specifically, it would be useful for me where you have installed your nextcloud (e.g. domain.com/nextcloud) and then explicitly mention the changes to the config.php file and .htaccess file and at what points during the installation process you have made them. That would be much appreciated!
The solutions mentioned above can also be found in the nextcloud docs: Proxy Configurations
Add this line to [root folder of nextcloud]/config/config.php:
'htaccess.RewriteBase' => '/',
Advice on parameter:
In a standard Apache setup this usually equals the folder that Nextcloud is accessible at. So if Nextcloud is accessible via “https://mycloud.org/nextcloud” the correct value would most likely be “/nextcloud”. If Nextcloud is running under “https://mycloud.org/” then it would be “/”.
Login to your server via SSH and navigate to your nextcloud folder
Run the following command to update your .htaccess file: occ maintenance:update:htaccess
(on my web hosting server I need to run it like this: php occ maintenance:update:htaccess)
You can update the .htcaccess file in nextcloud root folder manually but I only recommend that when you really know what you are doing.