Old Site to New Site with Map File

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 3
Joined: 29 Apr 2013, 16:57

Old Site to New Site with Map File

16 Nov 2013, 02:59

I'm trying to wrap my head about the map file. We went from an old ASP site to a wordpress driven site and there are a few hundred pages indexed that will take some time for the search engines to pick up the new addresses. Until then, I'd rather not see a mess of 404's.

Here's what the current .htaccess file looks like:

Code: Select all
# Helicon ISAPI_Rewrite configuration file
# Version 3.1.0.89

# BEGIN WordPress

RewriteEngine On

# Rewrite old urls
RewriteMap map txt:OldSiteMap.txt [NC]
RewriteCond %{REQUEST_URI} ^(.+)$ [NC]
RewriteCond ${map:%1|NOT_FOUND} !NOT_FOUND
RewriteRule .? ${map:%1} [NC,R=301,L]

RewriteBase /

RewriteCond %{REQUEST_URI} !^/(wp-admin|wp-admin/.*)$

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]


# END WordPress


Essentially, we have some pages that are indexed as such:

/rates/index.asp should be 301'd to /rates/
index.asp?cid=comedy should be 301'd to /laugh/
attractionsinfo.asp?cid=bigtrack should be 301'd to /track/super/
/stealsanddeals/weboffer/ to /specials/

I think you get the idea. I'm thinking the map is the best way. I still need the rewrite engine to process the WordPress rules too in the event that the page is valid in the current architecture.

Any insight you can provide would be great.

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: Old Site to New Site with Map File

18 Nov 2013, 11:05

Hello,

Yes, mapfiles would be the best shot. But I think I didn't get the question. You're saying everything is working (and, yes, it looks good), but you're asking about the collaboration of the two? Or did I miss something?

The two rules should work fine as is. Since your first rule has a check for entries in a mapfile. So, if it doesn't find the corresponding entry, it goes to the next rule.

Let me know if I didn't get the idea.

Regards
Andrew

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 17 guests