My 302 just doesn't want to know...

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
tossedsalad

My 302 just doesn't want to know...

Post by tossedsalad »

Hi!

I'm in the process of moving from a .com (currently hosted at location:A) to a .co.uk (currently hosted in location:B)

The plan is eventually to only host at location:B, probably in a month's time.

The .co.uk is waiting to be indexed currently (sandbox, I guess), meantime I've tried issuing a 302 redirect (from location:A to location:B), with the following code:

Code: Select all

<IfModule mod_rewrite.c>
	Options +FollowSymlinks
        RewriteEngine on
        RewriteCond %{HTTP_HOST] ^(www\.)?mydomain\.com [NC]
        RewriteRule ^(.*) http://www.mydomain.co.uk/ [R=302,L]
</IfModule>
But nothing happens.

Any thoughts?

David
tsw
Power Poster
Power Poster
Posts: 1408
Joined: Tue Dec 13, 2005 10:50 pm

Re: My 302 just doesn't want to know...

Post by tsw »

most probably its in rewritecond clause which you wont probably even need as everything gets redirected.

I think this might be a better variation

RewriteCond %{HTTP_HOST} !^www.mydomain.co.uk$ [NC]
RewriteRule ^(.*)$ www.mydomain.co.uk/$1 [R=302,L]

so everything not www.mydomain.co.uk would be redirected.

like www.domain.com/foo.html&nbsp; --> www.mydomain.co.ul/foo.html

(untested tho ;)
tossedsalad

Re: My 302 just doesn't want to know...

Post by tossedsalad »

I'm afraid that didn't work.  Firefox said that it was redirecting in a way that would "never complete"
tsw
Power Poster
Power Poster
Posts: 1408
Joined: Tue Dec 13, 2005 10:50 pm

Re: My 302 just doesn't want to know...

Post by tsw »

where are you setting that rewrite?

if you want the .com to be redirected to co.uk you need to set the redirectation in .com server, and as those are different servers (as stated in the first post) only thing co.uk server knows is that the client has bee redirected from .com server.
tossedsalad

Re: My 302 just doesn't want to know...

Post by tossedsalad »

Naturally, it's on the .com server
Pierre M.

Re: My 302 just doesn't want to know...

Post by Pierre M. »

Shouldn't we read 301 (permanently moved) rather than 302 (temporarily moved) ? Or is it me who is confused ?

Set a static page at B : ...domain.co.uk/page.html
Try it directly. Then issue an hard redirect just for it at A :
RewriteRule ^/old.cfm$ ...domain.co.uk/page.html [R=301,L] (as tsw wrote)
Does it work ? Then try :
wget http://...domain.com/old.cfm
(man wget to see how to activate verbose output)

PM
Locked

Return to “CMSMS Core”