Problem/Motivation

The current version of .ht.router.php does not work in conjunction with drupal-project. The script causes an redirect loop if it invoked from the project root.

php -S localhost:8888 -t web web/.ht.router.php

The root cause it the different cwd. getcwd() returns the project root and not the Drupal root.

Proposed resolution

Add chdir at the beginning of the script, or replace file_exists('.' . $url['path']) with file_exists(__DIR__ . $url['path'])

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#5 2970132-5.patch699 bytesneerajsingh

Comments

webflo created an issue. See original summary.

webflo’s picture

The is another is_file in the script.

cilefen’s picture

Issue tags: -Composer +Novice

This seems like something on which novices could make progress. I removed the “composer” tag because as far as I can tell, Composer isn’t involved in the bug.

neerajsingh’s picture

Assigned: Unassigned » neerajsingh

working on patch to have PHP constant __DIR__ .

neerajsingh’s picture

Status: Active » Needs review
StatusFileSize
new699 bytes

Attached patch for review.

neerajsingh’s picture

Assigned: neerajsingh » Unassigned
webflo’s picture

Status: Needs review » Reviewed & tested by the community

Thank you, look good.

alexpott’s picture

Crediting @webflo for reporting and reviewing the issue.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed 4ed1bcf646 to 8.6.x and 797b4bc250 to 8.5.x. Thanks!

  • alexpott committed 4ed1bcf on 8.6.x
    Issue #2970132 by neerajsingh, webflo: .ht.router.php causes a redirect...

  • alexpott committed 797b4bc on 8.5.x
    Issue #2970132 by neerajsingh, webflo: .ht.router.php causes a redirect...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.