I'm moving a website to drupal from another CMS.

In the old CMS the link for a news article was

http://www.example.com/news/news-item/1234

I moved the content to the drupal database preserving the same IDs

In the new Drupal web the articles can be accessed by

http://www.example.com/node/1234

How can I automatically redirect request to /node/1234 ?

I tried adding Redirect to the .htaccess file and I tried a couple of Rewrite instructions there as well (I am not very familiar with this matter). It didn't work.

How can this redirection be done?

Comments

batigolix’s picture

ooh what a shame,

i have to bump this.

sepeck’s picture

I don;t use htaccess. Why don't you post what specifically you tried. It may be that someone more experianced with htaccess will see it and respond with corrections.

-sp
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

batigolix’s picture

this is what i add to .htaccess

Redirect /news/news-item/ http://www.example.com/node/

but requests for

http://www.example.com/news/newsitem/1234

now go to

http://www.example.com/node/1234?q=blog/blog-item/1234

i suspect some drupal mechanism is getting in between

all suggestions are highly appreciated

venkat-rk’s picture

Why not use the pathauto module instead? It will let you rename http://www.example.com/node/1234
to
http://www.example.com/news/news-item/1234. In other words, exactly the same url as you had before. You can even suffix the path with .htm, .html, .php etc.

Here is another thread about the usefulness of pathauto in a similar situation to yours:
http://drupal.org/node/35569

batigolix’s picture

hombre!

works like a charm

i installed pathauto went to http://www.soahr.com/admin/settings/pathauto and put "/news/news-item/[nid]" in the field "Pattern for all story paths:" (all items happened to be "stories")

and it works!

(the thread you refer to wasn't very helpful though)

did i say already that drupal rocks? no? well, it rocks!

venkat-rk’s picture

Glad to know it solved your problem.