I noticed in the DrupalCon DC video that Mike talked about being able to do .htaccess URL redirects based on migrated nodes. I tried to follow his instructions, but it doesn't seem to be working for me. My legacy paths are a little bit different though. Here's what the legacy URLs look like:

/News/show_news.asp?id=4271

New Pathauto URLs look like:

/news/[title-raw]

Here's what my .htaccess code looks like right now:

  # Rewrite migrated news article URLs (Migrate module)
  # Old format: /News/show_news.asp?id=4271
  RewriteRule ^News/show_news.asp?id=(0-9+)$ /migrate/xlat/$1 [NC,R=301,L]

Can anyone see what I might be doing wrong?

Comments

attheshow’s picture

Version: 6.x-1.0-rc1 » 6.x-1.0
moshe weitzman’s picture

I didn't investigate, but I would think you also have to inform xlat about which migration you are speaking about. Or else it can't know which map table holds the answer for sourceID=4271

attheshow’s picture

Status: Active » Fixed

Ok, I finally got it figured out. It was the query string in my legacy URL that was giving me problems. In case anyone else runs into the same issue, here's what my final redirect rule looks like:

  # Rewrite migrated news article URLs (Migrate module)
  # Old format: /News/show_news.asp?id=4271
  RewriteCond %{QUERY_STRING} ^.*id=([0-9]+).*$
  RewriteRule ^News/show_news.asp.*$ /migrate/xlat/node/%1? [NC,R=301,L]

Status: Fixed » Closed (fixed)

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