# Beginner's question: redirecting /dir/index.html to /dir/

**URL:** <https://www.ruby-forum.com/t/beginners-question-redirecting-dir-index-html-to-dir/194757>\
**Category:** NGINX\
**Created:** [September 10, 2010, 12:23am UTC](https://www.ruby-forum.com/t/beginners-question-redirecting-dir-index-html-to-dir/194757 "2010-09-10T00:23:42Z")\
**Posts on this page:** 1\
**Page:** 2

<div class="post-metadata">

**Author:** ![ez77](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/fbc32d/32.png) [@ez77](https://www.ruby-forum.com/u/ez77)\
**Post date:** [September 14, 2010, 1:00am UTC](https://www.ruby-forum.com/t/beginners-question-redirecting-dir-index-html-to-dir/194757/21 "2010-09-14T01:00:52Z")

</div>

Another thought… Can the catch-all virtual host redirect with 301  
instead of 302? The less elegant solution employed 301. Thanks!

Posted at Nginx Forum:

> **[Re: Beginner's question: redirecting /dir/index.html to /dir/](https://forum.nginx.org/read.php?2,128951,130149#msg-130149)**
>
> Greetings, I'm trying to send all .../dir/index.html requests to .../dir/ . I looked this up in forums but I'm only able to do it for the root directory: \[code\] location / { root /var/www/mysite; index index.html index.htm; if

[Previous page](https://www.ruby-forum.com/t/beginners-question-redirecting-dir-index-html-to-dir/194757.md?page=1)
