Skip to content
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

We want to cancel hard code index.php and modify routing. #11188

Closed
jack9603301 opened this issue Sep 12, 2018 · 21 comments
Closed

We want to cancel hard code index.php and modify routing. #11188

jack9603301 opened this issue Sep 12, 2018 · 21 comments

Comments

@jack9603301
Copy link

It is hoped that the hard coded index.php will change the route, so that URL routing will be more beautiful.

@nextcloud-bot
Copy link
Member

GitMate.io thinks possibly related issues are #10402 (fulltextsearch:index not indexing modified files), #9027 (How to hide index.php in URI?), #7823 (Rewrite fails on Debian, index.php exposed in URL), #7828 (Rewrite works, but still index.php in filelisting), and #6784 (Php error?).

@weeman1337
Copy link
Member

Thanks for creating the issue. @jack9603301 could you give some more information please?
What is the system doing in your case? And how do you wish it should do?

@jack9603301
Copy link
Author

I want to arrange URL routing more scientifically and rationally, rather than having a string like index. phpin the URL routing, which seems more reasonable, otherwise, we'll have to solve this problem by nginx + ob_start handler + modifying some system files, which will become cumbersome and may cause other problems.

@kesselb
Copy link
Contributor

kesselb commented Sep 14, 2018

When you use the recommended nginx (https://docs.nextcloud.com/server/13/admin_manual/installation/nginx.html) configuration index.php is removed from most visible urls. Does this help?

@jack9603301
Copy link
Author

jack9603301 commented Sep 14, 2018

I've temporarily removed the display of index.php on the URL by technical means, but I'd prefer to remove this hard-coded routing from the source code

@kesselb
Copy link
Contributor

kesselb commented Sep 14, 2018

Could you be more specific what hard-coded routing you are referring to? Its pretty common to route all requests through index.php (most frameworks for php works this way). Please let me know if I misunderstood you. What problem are you trying to solve?

@jack9603301
Copy link
Author

jack9603301 commented Sep 14, 2018

The default routing for Nextcloud is sure to have index. phpin the URL, but it's not beautiful. I want to go somewhere in the middle of the URL `index. php'. For example, the default routing for Nextcloud is:

http://cloud.qhjack.cn/index.php/apps/files/?Dir=/&fileid=7

We hope that similar routing paths, such as `index.php', will not appear in the middle of the path, but more scientific and reasonable routing should be as follows:

http://cloud.qhjack.cn/apps/files/?Dir=/&fileid=7

@kesselb
Copy link
Contributor

kesselb commented Sep 14, 2018

https://docs.nextcloud.com/server/13/admin_manual/installation/source_installation.html#pretty-urls (you need to use the recommended nginx configuration). It does work on my local setup like you suggested.

image

You may try the official demo https://demo.nextcloud.com (pretty-urls enabled there as well).

@jack9603301
Copy link
Author

How to configure on nginx.

@kesselb
Copy link
Contributor

kesselb commented Sep 14, 2018

We manage software issue with nextcloud here. Please use https://help.nextcloud.com/ for configuration issues. You find the recommended nginx configuration here: https://docs.nextcloud.com/server/13/admin_manual/installation/nginx.html

@kesselb kesselb closed this as completed Sep 14, 2018
@jack9603301
Copy link
Author

However, in Nextcloud, a large number of paths still use index.php, such as:
20180915051346

@kesselb
Copy link
Contributor

kesselb commented Sep 14, 2018

👍 Looks like you have configured beautiful urls for your nextcloud. Do you want me to reopen this issue? Could you provide (please edit your first post to keep this clear) more information about your use case and why the remaining links to index.php are a problem for you?

we'll have to solve this problem by nginx + ob_start handler + modifying some system files,

I guess you dont need this anymore?

@jack9603301
Copy link
Author

Part of the URL links and routing styles can be solved by adding the overwrite. cli. url field to the config.php master configuration file, but a large number of links can still be found in the Nextcloud that have not been converted to new links.

@kesselb
Copy link
Contributor

kesselb commented Sep 15, 2018

@MorrisJobke @jospoortvliet reopen?

@MorrisJobke
Copy link
Member

Usually https://docs.nextcloud.com/server/13/admin_manual/installation/source_installation.html#pretty-urls should cover all of the requested stuff. Then Nextcloud will generate only the needed URLs as wanted. Could you check that?

@jack9603301
Copy link
Author

Who do you want to talk to?

@MorrisJobke
Copy link
Member

Who do you want to talk to?

Most likely you, as you have the problem. Did you followed the steps in there? Could you also check if there is a trailing slash in the override.cli.url if it only consists of the domain - something like "https://cloud.example.com/"?

@jack9603301
Copy link
Author

I checked the corresponding configuration records of config.php:

'overwrite.cli.url' => 'http://cloud.qhjack.cn/'

@Nottt
Copy link

Nottt commented Nov 16, 2018

Why is there no documentation on how to do this with nginx? :/

I have 'overwrite.cli.url' => 'https://domain.com' in my config.php and I still index.php everywhere.

@MorrisJobke
Copy link
Member

Why is there no documentation on how to do this with nginx? :/

If you use the config for Nginx that is in our documentation this should work. If not: reach out in the forums.

@Nottt
Copy link

Nottt commented Nov 16, 2018

Your documentation is missing the header add_header Referrer-Policy no-referrer always; to pass your own audit.

And it worked, after I fixed the issue where it couldn't find the cgi params file. You should also add there that this link will give pretty URL, remove index.php because when we are googling it doesn't even show up as a possible solution to the issue...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants