Skip to content

Get rid of index.php in the url [$50 awarded] #5744

Closed

Description

@DeepDiver1975

to be clear this is optional and we cannot rely on this.

more info to come ....

Activity

  1. karlitschek commented on Nov 7, 2013

    @karlitschek
    Contributor

    not sure we should spend time with this. than we have two different urls to maintain. and it is only cosmetic anyways

  2. DeepDiver1975 commented on Nov 7, 2013

    @DeepDiver1975
    ContributorAuthor

    My idea is to setup the rewrite rule in htaccess together with an environment variable if rewrite is enabled.

    Based on that variable we include index.php while generating the urls - or not.

    Why do we need to get rid of the index.php at all?
    1.) clean urls 😉
    2.) in some more complex web server setups we want to apply conditions, rules etc on generated routes. afaik this will not work if there is an index.php in the url

  3. karlitschek commented on Nov 7, 2013

    @karlitschek
    Contributor

    I figured you want to do that. I'm not convinced that it's worth the work looking at all he other issues like performance and feature requests. :-)

  4. DeepDiver1975 commented on Nov 7, 2013

    @DeepDiver1975
    ContributorAuthor

    at it's worth the work looking at all he other issues like performance and feature requests. :-)

    For sure - I scheduled it for oc7 - maybe someday ... 😉

  5. schmunk42 commented on Jan 22, 2014

    @schmunk42

    I am also desperately looking for a solution to this.

    First, I thought it would be a simple config or app setting, then I read many posts of people, which claimed they've accomplished this by setting mod_rewrite rules and owncloud would detect this magically in his own - I tried this without luck.
    Others say that in older version this would have been the standard behavior in previous versions and there are also people who say they fixed this with custom a dispatch.php.
    I read also some posts about problems with /index.php/... in the URL and eg. AppleDAV clients.

    Could you please shed some light on this issue, is it possible to do this or why is it not recommended?

    PS: Would be more than just a cosmetic issue for me, because cool URIs don't change ;)

  6. sauergeek commented on May 30, 2014

    @sauergeek

    I'm also looking for a solution for this, because under normal circumstances we block anything containing the string '.php' twice in the same URL, as a security measure. Most of the requests that we see of this form are attacks. Most of the rest of the requests that we see of this form involve badly-written student code. But under the hood, there are dozens of requests of this form in OwnCloud. There are no less than six such requests from a single login attempt.

  7. DanielRuf commented on Jun 21, 2014

    @DanielRuf

    +1
    It is quite easy: http://www.acloudtree.com/how-to-remove-index-php-from-owncloud-url-path/
    RewriteRule ^index.php/(.*) $1 [L]

    but I would also like to see it as a feature or setting in OC6. It is just one simple setting and one simple .htaccess rule so why should we schedule it for a later major release?

    Do you need some more developers?

    Some addition: it seems there is some problem with autoloading the class when using the RewriteRule in combination with legacy classes:
    Fatal error: Class 'OC_Util' not found in /settings/apps.php on line 24

    https://github.com/owncloud/core/blob/master/lib/autoloader.php

  8. PVince81 commented on Jul 1, 2014

    @PVince81
    Contributor

    Probably because the rewrite way is not clean enough.
    There are possibly other side effects and it might take some time to iron them out.

  9. koehn commented on Oct 8, 2014

    @koehn

    There's a great explanation of how to do this using mod_rewrite on Stack Overflow.

  10. tessus commented on Dec 5, 2014

    @tessus

    Although my other ticket was going into a different direction it was closed as a duplicate, thus I want to re-post here what I've mentioned there.

    There are actually 2 different topics:

    • removal of index.php from the URL
    • removal of .php from the URL

    While the first item is certainly appreciated, it doesn't solve the problem for all other URLs which have .php in them, e.g. https:/server/remote.php/webdav/ and https://server/remote.php/caldav/.
    So making https://server/index.php/apps/files to https://server/apps/files is definitely nice, but maybe it would be easier just to remove the .php extension from all URLs.
    In that case the default page would look like https://server/index/apps/files, but it'd be still better than before.

    Thus the 2nd item would be more consistent accross the environment and I believe also more maintainable. Removing the .php from the URL are 3 lines in .htaccess. Adding those 3 lines won't break anything, but would allow people to access https://server/remote.php/caldav/ as https://server/remote/caldav/.

    The next step would be to change the link creation and references in the server code. I don't know how much code has to be changed to accomplish this, but it should be rather straight forward to do so.

    Please let me know, if anything I wrote makes any sense to you.

  11. tessus commented on Jan 6, 2015

    @tessus

    @DeepDiver1975 Did you see my last comment? What do you think? Is this issue just for the removal of index.php, or .php altogether?
    Is there anything I can help with?

  12. DeepDiver1975 commented on Jan 6, 2015

    @DeepDiver1975
    ContributorAuthor

    from my understanding neither index.php, public.php nor remote.php shall be visible in the url.

    but this is a long way - I need to rethink on how to make this happen ....

  13. tessus commented on Jan 6, 2015

    @tessus

    well, you can drop me an email. maybe I can help.

  14. LukasReschke commented on Feb 11, 2015

    @LukasReschke
    Contributor

    Proposal is at #14081

  15. modified the milestone: backlog on Mar 21, 2015
  16. tessus commented on Sep 15, 2015

    @tessus

    @DeepDiver1975 are you still looking into this? just wondering. index.php and remote.php are still present in URLs.

    If you want, I can have a look at it as well. Please drop me an email or we can discuss this in this thread. I believe there are several ways to handle this. (e.g. remove index.php completely or replace it by something else, let's say cloud).

    What do you think? Is it worth looking into this again?

  17. karlitschek commented on Sep 15, 2015

    @karlitschek
    Contributor

    low priority from my point of view

  18. gsosna commented on Sep 15, 2015

    @gsosna

    Hmmm.... seems that some people REALLY want it and others REALLY couldn't care less. Is there any way of judging the community desire for this? What's being asked is pretty trivial, and is already possible with a couple of hacks in either httpd or nginx, yet even that is frowned upon here... ;-(

  19. karlitschek commented on Sep 15, 2015

    @karlitschek
    Contributor

    well if it's possible with some webserver config then this should be fine for the people who REALLY care how the urls look like. i assume that most core contributors are looking into more serious bugs and improvements at the moment. :-)

  20. DeepDiver1975 commented on Sep 15, 2015

    @DeepDiver1975
    ContributorAuthor

    What's being asked is pretty trivial,

    @gsosna you are very welcome to submit a pull request to fix this

    bildschirmfoto von 2015-09-15 09-59-25

  21. jospoortvliet commented on Sep 15, 2015

    @jospoortvliet

    One way of judging demand is bountysource: https://www.bountysource.com/issues/1328006-get-rid-of-index-php-in-the-url

    But that, too, isn't entirely objective - you can promote an issue a bit and it will get more support, of course. And not everybody has money ;-)

  22. jospoortvliet commented on Sep 15, 2015

    @jospoortvliet

    And as @karlitschek pointed out - if it is indeed a simple server setting, let's document it! I offer help with documenting it as, personally, I like shorter sharing links ;-)

  23. LukasReschke commented on Sep 15, 2015

    @LukasReschke
    Contributor

    A simple server setting won't fix this. Our routing will explode then in some cases, which makes the whole ownCloud explode. There needs to be at least 1 change to the router as done in #14081

    That said #14081 is pretty much complete but just requires somebody with time to fix all the unit tests etc…

  24. changed the title [-]Get rid of index.php in the url[/-] [+]Get rid of index.php in the url [$50 awarded][/+] on Feb 7, 2017
  25. lock commented on Aug 3, 2019

    @lock

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  26. locked as resolved and limited conversation to collaborators on Aug 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions