I have a htaccess file that starts with the usual stuff:
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
i.e. a few rewrites, for example:
RewriteRule ^protect/?$ /Legal/Your-Financial-Protection.aspx [NC, L, R=301]
then overwriting ends:
RewriteMap map txt:rewritemaps/map.txt [NC]
RewriteRule ^(.+)$ ${map:$1} [R=301]
The rewritemap contains all of our legacy URLs on our current site and short URLs that will be redirected to equivalent pages on the new site (about 4,000, so I really need to use a map):
Inspiration.aspx /Inspiration.aspx
Destinations/Africa/Countries/Gabon.aspx /Destinations/Africa/Gabon.aspx
indonesia /Destinations/Southeast-Asia/Indonesia.aspx
The problem is that with rewritemap turned on (i.e. not commented out) all my URLs (even those that don't match) are redirected to / - including stylesheets, js, images, etc.
What I need is a uris that matches the pattern on the map to redirect to a replacement and go through everything else (i.e. stay the same).
$1 :
RewriteRule ^(.+)$ ${map:$1|$1} [R=301]
. , .css,.js,.jpg .., .
FYI, ISAPIRewrite HeliconTech ( IIS 6), , rewritemaps apache, .
!
,