# Can www.example.com/...#!... always use controller=redirect

**URL:** <https://www.ruby-forum.com/t/can-www-example-com-always-use-controller-redirect/190746>\
**Category:** Rails\
**Created:** [June 26, 2010, 1:22pm UTC](https://www.ruby-forum.com/t/can-www-example-com-always-use-controller-redirect/190746 "2010-06-26T13:22:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![winterheat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7993a0/32.png) [@winterheat](https://www.ruby-forum.com/u/winterheat)\
**Post date:** [June 26, 2010, 1:22pm UTC](https://www.ruby-forum.com/t/can-www-example-com-always-use-controller-redirect/190746/1 "2010-06-26T13:22:45Z")

</div>

In Ruby on Rails routing (using route.rb), can it say, for any URL  
having the form:

```
www.example.com/ ... #! ...

```

then use controller `redirect` ?

This is so that in AJAX, some page can tag the `#!` at the end of URL so  
that the real content of interest is the part after the `#!`

---

<div class="post-metadata">

**Author:** ![winterheat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7993a0/32.png) [@winterheat](https://www.ruby-forum.com/u/winterheat)\
**Post date:** [June 26, 2010, 1:50pm UTC](https://www.ruby-forum.com/t/can-www-example-com-always-use-controller-redirect/190746/2 "2010-06-26T13:50:27Z")

</div>

Site\_url = [www.example.com](http://www.example.com)  
redirected\_to #{site\_url}

or directly in routes.rb can work a bit you have to google

On Sat, Jun 26, 2010 at 4:52 PM, Jian L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

–  
Thanks:  
Rajeev sharma
