You can put an index.php file in your public directory:
PHP Code:<?
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.newsite.com" );
?>
Is this OK for you?
Hi
I want to redirect 3 domains to point at one
i.e I have
www.widgets.com
www.widget.co.uk
www.widget.com
I want to redirect all of them to www.widgets.co.uk
I have redirected directories but not whole sites before with .htacess.
Can someone suggest the code I need I guess it will be a 301 redirect.
You can put an index.php file in your public directory:
PHP Code:<?
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.newsite.com" );
?>
Is this OK for you?
I always use the following if I can't setup the redirection on my dns
I don't know anything about .htaccess I'm afraidPHP Code:$handledir = $_SERVER['HTTP_HOST'];
if (($handledir == "www.mysite.co.uk") OR ($handledir == "www.mysites.co.uk") OR ($handledir == "www.mysites.com")) {
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.mysite.com");
exit();
}
Ta
ive got to admit that .htaccess isnt my strong point but i think the following will achieve what you want.
(thinking about it the above will probably only work if all the domains are set to the same webspace)PHP Code:RewriteCond %{HTTP_HOST} !^www.widgets.co.uk
RewriteRule ^(.*)$ http://www\.widgets\.co\.uk/$1 [R=301,L]
cheers
mxp
Last edited by mxp; 07-09-05 at 03:01 PM.
Maybe both threads have to be merged:
http://www.a4uforum.co.uk/showthread.php?t=34118
&
http://www.a4uforum.co.uk/showthread.php?t=34119
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks