# Redirecting ENTIRE directory to one html page

**URL:** <https://forum.kirupa.com/t/redirecting-entire-directory-to-one-html-page/291135>\
**Category:** web dev\
**Created:** [June 25, 2009, 2:40am UTC](https://forum.kirupa.com/t/redirecting-entire-directory-to-one-html-page/291135 "2009-06-25T02:40:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![iLikePie](https://avatars.discourse-cdn.com/v4/letter/i/85f322/32.png) [@iLikePie](https://forum.kirupa.com/u/iLikePie)\
**Post date:** [June 25, 2009, 2:40am UTC](https://forum.kirupa.com/t/redirecting-entire-directory-to-one-html-page/291135/1 "2009-06-25T02:40:35Z")

</div>

\*\*NOTE : this problem is fixed 🙂  
\*\*

Hi guys,

I’m trying to redirect an old site to a new domain, but the site structure has changed significantly.  
I’m using the .htaccess file and the Redirect command.

If i write

```auto
redirect 301 / http://www.newsite.com/

```

it does redirect all the pages, but it tries to take them to their equivalent page in the new domain… for example, [www.oldsite.com/cheese.html](http://www.oldsite.com/cheese.html) tries to redirect to [www.newsite.com/cheese.html](http://www.newsite.com/cheese.html)

but I want ALL the old pages to go to the index page, as the new site doesn’t really have equivalents for the pages. I have tried adding index.html to the end of the redirect but it still doesn’t work.

Typing each one in manually would be an option if needed, except that the old site is REALLY old, using frames and a sidebar, and the redirect doesn’t seem to like that, they’re just not working at all.

any ideas?

- stuart

EDIT:

OK, i’ve kindof got it half working. I have used this code

```auto
RedirectMatch 301 ^/.*$ http://www.newsite.com.au/index.html

```

which I don’t fully understand, but is working for some pages.  
However some other pages just don’t redirect. I can’t work out why… 2 pages that look almost identical HTML wise are behaving differently, with only one redirecting and the other loading as usual?!
