# Best way to deal with a changed url?

**URL:** <https://www.ruby-forum.com/t/best-way-to-deal-with-a-changed-url/121901>\
**Category:** Rails\
**Created:** [December 2, 2007, 5:36pm UTC](https://www.ruby-forum.com/t/best-way-to-deal-with-a-changed-url/121901 "2007-12-02T17:36:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![idlefingers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/898d66/32.png) [@idlefingers](https://www.ruby-forum.com/u/idlefingers)\
**Post date:** [December 2, 2007, 5:36pm UTC](https://www.ruby-forum.com/t/best-way-to-deal-with-a-changed-url/121901/1 "2007-12-02T17:36:28Z")

</div>

I have an app which lists events and uses slug generated from the  
event title for the url. Anyway, I noticed a couple of characters had  
been used in an event title which I’d forgotten to deal with and so  
amended my code and regenerated the slug for the event. That’s all  
fine but now I’ve noticed a lot of traffic coming from google to the  
old url and people getting 404 errors.

So, what’s the best way to redirect people to the new url? Is there  
something I can do in the .htaccess file to redirect? I tried adding a  
couple of Redirect 301 lines in the .htaccess file for the offending  
urls but it didn’t seem to work (still got 404 errors).

Thanks in advance for any help…

---

<div class="post-metadata">

**Author:** ![idlefingers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/898d66/32.png) [@idlefingers](https://www.ruby-forum.com/u/idlefingers)\
**Post date:** [December 3, 2007, 7:58pm UTC](https://www.ruby-forum.com/t/best-way-to-deal-with-a-changed-url/121901/2 "2007-12-03T19:58:56Z")

</div>

Anyone??

---

<div class="post-metadata">

**Author:** ![idlefingers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/898d66/32.png) [@idlefingers](https://www.ruby-forum.com/u/idlefingers)\
**Post date:** [December 3, 2007, 8:00pm UTC](https://www.ruby-forum.com/t/best-way-to-deal-with-a-changed-url/121901/3 "2007-12-03T20:00:42Z")

</div>

On Dec 3, 2007 12:58 PM, idleFingers [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Anyone??

mod\_rewrite if Apache

–  
Greg D.  
[http://destiney.com/](http://destiney.com/)

---

<div class="post-metadata">

**Author:** ![idlefingers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/898d66/32.png) [@idlefingers](https://www.ruby-forum.com/u/idlefingers)\
**Post date:** [December 3, 2007, 8:12pm UTC](https://www.ruby-forum.com/t/best-way-to-deal-with-a-changed-url/121901/4 "2007-12-03T20:12:24Z")

</div>

Doesn’t that just make it so the old url will work again? …and not  
actually redirect? I’m wanting it to redirect so it can be indexed on  
search engines on the new url…
