# redirect home page to sub directory



## bluphoto (Aug 15, 2009)

I have a site with a root named "XYZ.com".

Within the "public" folder, I have subfolders called "page1", "page2", "Page3" etc. Each of these folders has it's own index.php inside it.

Currently, the "home" page is served from the root level, ie the index.php is in the "public" folder.

I want to move this to a "home" folder within the public folder (same as page1, page2, etc)

I want to keep page1, page2 folders etc where they are.

So I want XYZ.com to use the page found in "XYZ.com/home", but "XYZ.com/page1" to remain as "XYZ.com/page1" etc.
rgds,
Guy


----------



## Redcore (Aug 14, 2007)

So you want "xyz.com/index.php" to redirect to "xyz.com/home/index.php" ?


----------



## bluphoto (Aug 15, 2009)

Yes, that's right, but only that one page.


----------



## Cloudster (May 30, 2010)

I have a similar situation. In my case, I was too lazy to create a home page, so I created a .htaccsess file to redirect the root directory to an index.php in a subdirectory.

Some htaaccess editors:

http://www.htaccesseditor.com/en.shtml
http://htaccesser.apacheblog.de/index-nojs.php


----------



## Redcore (Aug 14, 2007)

*In PHP:*

_xyz.com/index.php _

```
<?php
// forward to home page
header("Location: /home/index.php");
?>
```


----------

