# Rewrite redirect whole directory to root

**URL:** <https://forum.kirupa.com/t/rewrite-redirect-whole-directory-to-root/229936>\
**Category:** programming\
**Created:** [June 21, 2007, 11:41am UTC](https://forum.kirupa.com/t/rewrite-redirect-whole-directory-to-root/229936 "2007-06-21T11:41:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![duncanhall](https://avatars.discourse-cdn.com/v4/letter/d/ad7895/32.png) [@duncanhall](https://forum.kirupa.com/u/duncanhall)\
**Post date:** [June 21, 2007, 11:41am UTC](https://forum.kirupa.com/t/rewrite-redirect-whole-directory-to-root/229936/1 "2007-06-21T11:41:40Z")

</div>

Google seems to have annoyingly picked up some links to development areas of a site I’ve just finsihed. These pages are either no longer there, or I don’t want them looked at.

I’d like to redirect anything in the folder “[domain.co.uk/dev/](http://domain.co.uk/dev/)” back to simply just point at the homepage “[domain.co.uk](http://domain.co.uk)”

I thought this would be straight forward, but I can’t seem to get it right.

I’ve tried various different combinations of this:

```auto

RewriteRule ^dev/? http://www.domain.co.uk/ [R=301]

```

But nothing seems to work. It either does nothing, or it cocks up apache and I get a load of Internal Server Errors.
