After upgrading from alpha2 to alpha3 I noticed that my urls now have "?q=" in them. Such as http://mysite.org/developments?q=developments and /admin/reports/dblog?q=admin/reports/dblog.

Here are the redirect settings:

Comments

oheller created an issue. See original summary.

oheller’s picture

Issue summary: View changes
StatusFileSize
new299.58 KB
Anonymous’s picture

Assigned: Unassigned »

I can confirm that the issue was fixed simply by reverting back to 8.x-1.0-alpha2 from 8.x-1.0-alpha3. I didn't even revert the configuration changes that were made during the update hook.

I'll come back later with a solution to this.

EDIT: This issue caused the xmlsitemap.module to generate a sitemap.xml file that didn't use aliases.

EDIT 2: My issue was actually with #2822190: PathValidator validates based on a RequestContext leaked from the current request, resulting in false negatives during CLI requests and POST submissions and there were a couple of different factors that made the bug show up.

berdir’s picture

Status: Active » Postponed (maintainer needs more info)

The only explanation I have for this is that your Drupal actually thinks it needs this and it *generates* such links. That's obviously bad as it mean that every single request needs a redirect first? How do your links look like? If so then this is a problem with your configuration/set up and not the fault of this module.

Pretty sure we have tests for this and that it is working.

oheller’s picture

Berdir, I'm not sure what you mean by how my links look like.

I am using Drupal 8.2.6. We are using pathauto to generate some paths. I looked at the redirect page and noticed that we had a number of urls, because we have the option to set a redirect when the url alias was changed. I deleted all of them. Upon updating the redirect module I found the urls again with ?q=.

I'm more than willing to think that we did something funky to make this happen, but it's also affecting the sites admin urls, which I'm sceptical to take credit for.

I just created a fresh D8.2.6 install and installed the latest redirect with drush. After enabling it, node/2 became node/2?q=node/2.
Upon uninstalling redirect, the urls went back to before. node/2

wesleydv’s picture

Status: Postponed (maintainer needs more info) » Active

I have the same issue, and like oheller the issue disappears after uninstalling

berdir’s picture

I don't see why you would get that ?q. Drupal 8 doesn't do that. do you use apache, nginx, ..? do you have some old Drupal 7 configuration there that populates the q variable?

webflo’s picture

StatusFileSize
new1.39 MB

The issue is related to caching in the RouteProvider, i don't understand it completely. Maybe the screenshot from my xdebug session helps.

webflo’s picture

I filled a issue against drush https://github.com/drush-ops/drush/pull/2599

berdir’s picture

Status: Active » Postponed (maintainer needs more info)

That was committed. Make sure you update drush to have that fix and then report back if you still have any problems.

davps’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new110.61 KB

All what you need is to disable the option 'Enforce clean and canonical URLs' on settings page.

In 8.x-1.0-alpha3 was added new class RouteNormalizerRequestSubscriber and new option 'route_normalizer_enabled' in settings with default value TRUE.

Best solution (patch) for this issue, as I think, set default value to FALSE for route_normalizer_enabled setting.

berdir’s picture

Status: Needs review » Postponed (maintainer needs more info)

You are supposed to have this enabled. If you don't, then you don't get redirects to aliases or based on language detection, trailing / and so on.

Again, the most likely cause for anything weird happening is a misconfiguration in apache/nginx or using a drush run-server without the bugfix linked above.

aveldina’s picture

Same issue here, appeared after updating from alpha2 to alpha4. A downgrade back to alpha2 resolves it. Am using Nginx.

berdir’s picture

As mentioned before, most likely you are still using 7.x configuration. Remove the ?q= stuff from your nginx configuration, it is not needed and wrong for D8.

oheller’s picture

I'm using Kalabox 2.1.3-dev and the drupal8.conf file in the ~/Kalabox/project/config/nginx/drupal8.conf needs to be updated.
At least lines 73-79 replace with :

location / {
      # auth_basic $auth_basic_realm;
      try_files $uri /index.php?$query_string;
      # Catch directory listing errors (i.e. no code)
      error_page 403 /403.html;
      # error_page 301 =301 $client_scheme://$host$uri/$is_args$args;
  }
berdir’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Closing issues that have not been providing additional information for over a month.

bburg’s picture

After running into this circular redirect on the latest version (8.x-1.5), here are the changes I made to my nginx config. Old lines are commented out. I just replaced them with the equivalent from https://www.nginx.com/resources/wiki/start/topics/recipes/drupal/.

    location / {
        try_files $uri /index.php?$query_string; # For Drupal >= 7
        # try_files $uri $uri/ @rewrite;
    }
    location @rewrite {
        rewrite ^/(.*)$ /index.php?q=$1;
        # rewrite ^/(.*)$ /index.php?q=$1;
    }