Suppose you have a site: www.example.com, with a URL alias for example.com then requesting a URL like:

example.com/url-with-%25-percentage-symbol

then this get 301'd to:

www.example.com/url-with-%2525-percentage-symbol

As the percent symbol is escaped by the mod_rewrite.

The solution is to use the NE flag in the RewriteRule directive in the htaccess.

Is this the correct solution? (It works btw)

Comments

Anonymous’s picture

This seems reasonable to me and is the intended use of NE. I've no problem with that.

I'll leave to anarcat to weigh in if he foresees any problem here

Steven Jones’s picture

Assigned: Unassigned » Steven Jones

Anarcat mentioned in IRC that it looked fine.

Steven Jones’s picture

Status: Active » Fixed

Fix pushed to all branches.

Status: Fixed » Closed (fixed)

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

  • Commit 6d0a23c on 6.x-1.x, dev-drupal-8, dev-ssl-ip-allocation-refactor, dev-1205458-move_sites_out_of_platforms, 7.x-3.x, dev-subdir-multiserver, 6.x-2.x-backports, dev-helmo-3.x by Steven Jones:
    Issue #1396326 by Steven Jones: Fixed Mod rewrite double escapes URLs.
    
    
  • Commit fa17f7a on 6.x-2.x, dev-ssl-ip-allocation-refactor, dev-1205458-move_sites_out_of_platforms, 7.x-3.x, dev-subdir-multiserver, 6.x-2.x-backports, dev-helmo-3.x by Steven Jones:
    Issue #1396326 by Steven Jones: Fixed Mod rewrite double escapes URLs.