# Custom Routes making permanent URLs with redirects

**URL:** <https://www.ruby-forum.com/t/custom-routes-making-permanent-urls-with-redirects/134367>\
**Category:** Rails\
**Created:** [April 10, 2008, 7:05am UTC](https://www.ruby-forum.com/t/custom-routes-making-permanent-urls-with-redirects/134367 "2008-04-10T07:05:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/9f8e36/32.png) [@kim](https://www.ruby-forum.com/u/kim)\
**Post date:** [April 10, 2008, 7:05am UTC](https://www.ruby-forum.com/t/custom-routes-making-permanent-urls-with-redirects/134367/1 "2008-04-10T07:05:53Z")

</div>

Hello,  
I am looking for guidance, suggestions and best strategies on how to  
create readable, permanent URLs for my project.

I have a project that serves up two types of pages:  
subject help guides  
course help guides

So I need a URL for the list of subject guides and a URL for a list of  
course guides. I also need URLs for each individual course page and a  
URL for the individual subject guides that consist of multiple subject  
pages.

I’ve been reading:  
[http://www.w3.org/Provider/Style/URI](http://www.w3.org/Provider/Style/URI)  
I agree with this - but question the no-subjects in URLs guideline.

> **[URL as UI](https://www.nngroup.com/articles/url-as-ui/)**
>
> Users continue to type and guess URLs and domain names, so Web usability can be improved by better URLs. In the long term this machine-level addressing scheme must be hidden.

Dated but good

What are peoples ideas on good readable urls?  
I am wondering how to handle the ids - can I hide them with routes?  
Do people use the to params method?

[http://www.notsostupid.com/blog/2006/07/07/urls-on-rails/](http://www.notsostupid.com/blog/2006/07/07/urls-on-rails/)  
[http://plasmasturm.org/log/358/](http://plasmasturm.org/log/358/)  
How do I do the redirect with my routes. All the examples of  
redirecting with a 302 is from the old action to the new, but I want  
to redirect them when they enter /id-BULL! to /id-ba214 (see last  
link)

Thanks for the help and I hope to get some good discussions.  
K

---

<div class="post-metadata">

**Author:** ![kim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/9f8e36/32.png) [@kim](https://www.ruby-forum.com/u/kim)\
**Post date:** [April 10, 2008, 7:18am UTC](https://www.ruby-forum.com/t/custom-routes-making-permanent-urls-with-redirects/134367/2 "2008-04-10T07:18:09Z")

</div>

You could do the one where you say:

[http://someserver/this\_link\_will\_never\_change/some\_id;this\_part\_is\_disregarded\_by\_rails\_and\_can\_be\_anything\_you\_like](http://someserver/this_link_will_never_change/some_id;this_part_is_disregarded_by_rails_and_can_be_anything_you_like)

Julian.

Learn Ruby on Rails! Check out the FREE VIDS (for a limited time)  
VIDEO #3 out NOW!  
[http://sensei.zenunit.com/](http://sensei.zenunit.com/)
