I am not sure if this is in the scope of this module but it's something I noticed. (It is also true for the 5.x version, with and without GR).

When a path is typed in with a "?" and no "q" the front page is returned but the URL is kept intact.

For example the following links all return the front page but keep the link in the address bar:
http://goodwinsolutions.com
http://goodwinsolutions.com/?
http://goodwinsolutions.com/?=node/4

Drupal, by default, redirects anything with a "?" and no "q" to the front page. Would it be better, and in the scope of GR, to create a pseudo alias that redirects all "?" without "q" URL's to the front page and rewrite them to root?

For example:

http://goodwinsolutions.com/? ----> http://goodwinsolutions.com
http://goodwinsolutions.com/?=node/4 ----> http://goodwinsolutions.com (OR in this case) ----> http://goodwinsolutions.com/{alias or /node/4}

Comments

nicholasThompson’s picture

http://goodwinsolutions.com/?=node/4

That is not a valid URL as there is no 'key' to the ?key=value pair.

Cory Goodwin’s picture

Quote from nicholasThompson: That is not a valid URL as there is no 'key' to the ?key=value pair.

The "?" stops the 404 page for returning and Drupal returns the home page. I see three options.

1. Redirect to the front page (but URL should be redirected to root as well.)

2. GR could redirect to the 404 page since it's not a valid URL.

3. It can interpret that this URL is for node/4 and redirect to the appropriate alias.

nicholasThompson’s picture

Title: Redirect on "?" without a "q" » Redirect on on URL's with an unclean query string
Version: 6.x-1.0 » 6.x-1.x-dev

Hmm interesting - I just tested it assuming it wouldn't work (due to the lack of key) but it does...

Maybe GR could parse the URL for any entries in $_GET that doesn't have a key and wipe them out?! The issue is if any other module relies on this.

Good find though!

nicholasThompson’s picture

I've just taken a quick look and it appears (logically I suppose) that you cannot actually SEE any arguments in $_GET or $_REQUEST for query parameters with no key.

You can, however, examine $_SERVER['QUERY_STRING']. For example, upon requesting http://www.example.com/admin?=node/4 you will see this in the query string variable =node/3&q=admin.

Any suggestions on any funky regex to clean that up (+any variants)?!

nicholasThompson’s picture

Title: Redirect on on URL's with an unclean query string » Cleanup untidy query string
Status: Active » Postponed

Marking as postponed until a "sensible" solution to this complex and interesting issue....