Bug 53757 - RewriteMap of type txt should allow specifying columns
Summary: RewriteMap of type txt should allow specifying columns
Status: NEW
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_rewrite (show other bugs)
Version: 2.4-HEAD
Hardware: All All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-21 17:04 UTC by Mikhail T.
Modified: 2012-08-21 17:04 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail T. 2012-08-21 17:04:25 UTC
In my particular case to improve a site's search-engine rankings, I needed two RewriteMaps:

1. Mapping old, numbered URLs to new ones containing article-titles.
2. Mapping new SEO URLs to the old numbered ones.

The current implementation of txt-map requires me to keep two files for this -- with columns swapped between them:

    RewriteMap old2new txt:old2new.txt
    RewriteMap new2old txt:new2old.txt

I'd like to be able to tell, when defining a txt-map, which column in the specified file to treat as the map's key and which -- as value. Something like:

    RewriteMap old2new txt:1,2:old2new.txt
    RewriteMap new2old txt:2,1:old2new.txt

The run-time memory requirements would be exactly the same, but the mapping-synchronization issues I am currently facing would disappear -- there will be no need to maintain the separate new2old.txt file.

I can also imagine other use-cases, where the same file may be used for other purposes and contain multiple columns -- only two of which would be used for building a particular map. BTW, the idea is based on the GNUPlot's flexibility in this regard.

Going further along these lines, being able to specify the column-separator may be useful to some people... I can cook-up a patch, if the idea seems sound to the would-be committer(s).