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

Redirect during instalation. #25

Closed
ghost opened this issue Aug 1, 2016 · 10 comments
Closed

Redirect during instalation. #25

ghost opened this issue Aug 1, 2016 · 10 comments
Assignees
Labels
Milestone

Comments

@ghost
Copy link

ghost commented Aug 1, 2016

Issue by @wad2eq
August 1st, 2016, 07:19 GMT

I'm trying install contao on localhost i put in adress bar localhost/contao/web/install.php i check box i agree with Contidion and i get redirection do localhost/contao/install and error 404

@ghost
Copy link
Author

ghost commented Aug 1, 2016

Comment by @leofeyer
August 1st, 2016, 07:29 GMT

You need to set up a document root pointing to the /web subfolder, so you can e.g. access the install tool via http://contao.dev/install.php.

@ghost
Copy link
Author

ghost commented Aug 1, 2016

Comment by @aschempp
August 1st, 2016, 08:25 GMT

This is a bug I can confirm, localhost is supposed to work with web folder. But for now you can just fix the URL manually by using localhost/web/app.php/contao/install

@ghost
Copy link
Author

ghost commented Aug 1, 2016

Comment by @leofeyer
August 1st, 2016, 09:03 GMT

localhost is supposed to work with web folder

It is?

@ghost
Copy link
Author

ghost commented Aug 1, 2016

Comment by @leofeyer
August 1st, 2016, 09:04 GMT

You are right. 😄

@leofeyer leofeyer added the defect label Aug 1, 2016
@leofeyer leofeyer added this to the 1.1.3 milestone Aug 1, 2016
@fritzmg
Copy link
Contributor

fritzmg commented Aug 1, 2016

It is?

Yes, I already pointed that out here: #18 (comment) ;)

The original issue (#18) unfortunately wasn't fixed after all. The problem is, that an empty base URL is set here now: https://github.com/contao/installation-bundle/blob/1.1.2/src/HttpKernel/InstallationKernel.php#L121

$context = new RequestContext();
$context->fromRequest(Request::createFromGlobals());
$context->setBaseUrl('');

Since the base URL is empty, the router generates routes without /web for example. But without setting the base URL (thus leaving the default base URL), the router would generate the URL like so: /web/install.php/contao/install which is also wrong of course.

In order to fix it, the base URL would need to be set manually with the current base web path of the Request - with /install.php (the current SCRIPT_NAME) removed. But that's not a pretty solution either, I think.

@leofeyer
Copy link
Member

leofeyer commented Aug 2, 2016

If the /web fragment is present, we must assume that URL rewriting has not yet been configured, therefore we would need to redirect to /web/app.php/contao/install, wouldn't we?

@aschempp
Copy link
Member

aschempp commented Aug 2, 2016

Shouldn't the path be automatically handled by the Symfony router or url generator?

@leofeyer
Copy link
Member

leofeyer commented Aug 2, 2016

I think you need to re-read the ticket. 😉

@leofeyer
Copy link
Member

leofeyer commented Aug 2, 2016

Fixed in 571ae0f.

@leofeyer leofeyer closed this as completed Aug 2, 2016
@fritzmg
Copy link
Contributor

fritzmg commented Mar 1, 2017

This is a problem again in contao/standard-edition and contao/managed-edition. Accessing http://localhost/contao4/web/install.php redirects to http://localhost/contao/install.

fritzmg added a commit to fritzmg/installation-bundle that referenced this issue Mar 1, 2017
This fixes contao#18, contao#25. This change was introduced somewhere between 64588df and a506423 (the adding of this line is not documented in the history of the file apparently?).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants