[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] htaccess and redirect



At 3:08 pm -0800 26/04/2000, RHLinux wrote:
how do i use htpaccess to redirect domain.com/ domain.com/anything to
another domain?


Hi
i've only done this with subsections of a site, by putting an .htaccess file at the root level or in the relevant subdirectory, containing the line

Redirect /subdirectory http://www.newdomain.com

or if you want it to redirect to a particular bit of the new site:

Redirect /subdirectory http://www.newdomain.com/subdirectory

You can apply it to any specific directory, e.g.

Redirect /subdirectory/subsubdirectory http://www.newdomain.com

and you can have multiple entries - new line for each.

I would guess for a whole site the syntax would be

Redirect / http://www.newdomain.com/

with the .htaccess file at the top level. I added the trailing slash here because I think the Apache docs say they have to match, but you might want to check that. You could try this anyway and see if it works. In all these cases everything lower down the hierarchy gets redirected automatically.

cheers
Fiona