-
-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove index.php from urls #412
Comments
This comment has been minimized.
This comment has been minimized.
The .htaccess being writable seems to be a requirement for this to work, however, as a side-effect of being in a snap, it's read-only (and disabled anyway for performance reasons). There might be things we could do on the Apache side, but the necessary changes don't appear to be documented anywhere. |
This comment has been minimized.
This comment has been minimized.
@kyrofa i see your point, but (just digging into this) I expect the apache config to be read-only, too. It is also inside the snap, am I right? If we can control the scenario were in, because in a snap it should be in a state we defined, can't we just enable this feature by default? |
You're right that the snap is in a state we've defined, and like I said I bet there are things we could do to make this work, but I have the same concerns I had back when #115 was raised: there have been issues caused by this in the past, and it's not something that Nextcloud enables by default, so I'm not sure we should either. We could hide it behind a switch, but again, that requires us to know what modifications we need to make. |
@kyrofa Thanks for pointing me. Since people are interested in this, how do we go forward? Is there a list of issues related to this feature and/or a strategy how to solve those? |
Could one not use a functionality similar to this, to enable such a feature? https://github.com/nextcloud/nextcloud-snap/pull/416/files |
Yeah I was thinking the same. However, I don't actually know what changes are done in the .htaccess (which we'll need to make in Apache instead) to make this work. |
@kyrofa Thanks for your time. I really appreciate that. The .htaccess is being included in the apache configuration, like this: https://github.com/nextcloud/nextcloud-snap/blob/master/src/apache/conf/httpd.conf#L130 Therefore, i expect there is nothing but the assertion, if the file is writable needs to be 'changed'. The only thing within the .htaccess file that needs to be changed (or even not) is the RewriteBase Directive. But since you connect the entire Domain against your nextcloud with this, it should be left untouched with '/'. |
The typical process to enabling this looks something like this as far as I understand:
The .htaccess is being included, yes, but it's not writable. As a result, the second step above will, I assume, be met with failure. Since it can't modify the .htaccess, we'll need to figure out what modifications it would have made, and make them straight in Apache instead. |
I just ran these:
The later would only change, as stated above, that the RewriteBase would be set to '/'. (which I think is the default, anyway?) |
Wait, so |
i.e. step 1 does nothing without step 2? |
@kyrofa AFAIK that's correct. |
@kyrofa Thanks for the time, you put into that. How do you think do we continue on this? |
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
+1 although it makes sense this isn't the default behaviour, some document working commands to enable this as a preference would be awesome |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
+1 |
This comment has been minimized.
This comment has been minimized.
2 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
A nginx reverse proxy and some tricky configuration can remove the index.php imperfectly.
Known issues:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
Here is a working POC but it seems like it is too much of an hack to be considered as solution for this issue: #1700 |
Subscribed for updates on this issue, but seems as if in owncloud/core#5744, owncloud/core#14081, and many other forums scattered across the web that configuration of pretty URIs is still difficult and arcane knowledge. |
I managed to figure it out, without mounting the snap read/write. Disclaimer: this is the first snap I've ever worked with. I know pretty much nothing about them, so there's probably a better way than how I did it (once it's clear what exactly I did). What I did was copy the .htaccess file from inside the snap, to the config directory, then used a bind mount to overlay the copy on top of the original, then restarted apache. Here's the steps: To enable the mount point automatically, add the following to your /etc/fstab file: Note, this does rely on symlinks (/snap/nextcloud/current). Systemd mounting doesn't work with symlinks, but that's fine here, since the link itself wouldn't change unless there was an update. The symlink is parsed only during evaluation (daemon-reload or reboot). Gotchas:
EDIT: On a side note... snaps seems like a really bad design. I feel like I shouldn't be allowed to do that. |
@Gwindalmir Great, thanks for the pointer to using bind mounts for this! For me your exact instructions didn't work; I was about to mount my editable .htaccess as for instance |
This issue is stale because it has been without activity for 60 days. It will be closed after 7 more days of inactivity. |
Uh i thought there was a PoC |
Hello, I'm interested, but I'havn't understanding the solution. It is possible help me? Thanks you. |
This issue is stale because it has been without activity for 60 days. It will be closed after 7 more days of inactivity. |
Interested in progress here... looks like some change in Nginx routing may do it? |
not sure, but i also think it would be nice 🤔 |
Seems this issue still not be solved. I really like Pretty URL. But anyway, Thank you guys for your wonderful jobs in this field, and I run this version very well, and Cool. |
Hello, a lot of time passed and I wonder if in the meantime a solution for this problem has been found? |
@Gwindalmir This worked out the box for me as per your instructions on Nextcloud v24. One question, have you managed to update the navigation in Nextcloud perhaps? All my links still reference index.php but are accessible with or without it in the URL. |
I didn't even notice the links still have index.php in them, at least the file links themselves do. App and other links don't. Note, I don't use the snap anymore. I moved the installation to a new system using docker instead. I have far more control now. |
I just installed the snap version of NextCloud and tried @Gwindalmir steps and it worked for me. This is my first time working with snaps and it's taken some getting used to. I really like NextCloud so far! |
been a long time! +1 |
noticed today that I'm getting the below error and wondering if it's due to performing the steps given by @Gwindalmir
and clicking on List of invalid files gives the following
|
@nextcloud-snap @kyrofa this issue has been open for 7 years. I see that @szaimen worked on this awhile back with #1794 but was unable to finish due to technical reasons. As an easy workaround, would you consider supporting the solution by @Gwindalmir with a simple command such as... nextcloud.enable-pretty-urls It could run a small script that implements the solution above, nothing major. 😊 |
I'm afraid not, for two reasons:
|
Understood. Maybe the ticket should close? Hopefully nextcloud will consider enabling this by default or provide a method to handle this without using Thanks for the info. |
No need to close it, I still think this is possible to pull off, it's just not high on the list of priorities for the maintainers. Contributions always welcome! |
Hi,
How would I go about removing index.php from the url?
I've tried adding
'htaccess.RewriteBase' => '/',
toconfig.php
and then runningsudo nextcloud.occ maintenance:update:htaccess
, but I get the following error:The text was updated successfully, but these errors were encountered: