Redirecting everything under one domain to a single page


#1

Hi
I’m a little stumped with a small problem where I have created a new website to replace an older one.
I have used a different domain and used wordpress through dreamhost.
To change over, I used Edit and then Redirect from the dreamhost panel.

So now, www.old.org forwards to www.new.com

My problem is when you try to go to www.old.org/Main/aPage

You get redirected to www.new.com/Main/aPage
aPage doesn’t exist on my new website and neither does Main, and unfortunately it doesn’t have the sense to go to www.new.com on its own like I entered in the box on dreamhost.

To make everything easier, I would just like to have everything under www.old.org forward to the homepage www.new.com

I’m fairly new to all this but have done a little research, and some have suggested editing a .htaccess file.

Would this be the correct procedure?
Or is there a Dreamhost setting I can edit to make this work?

thanks


#2

Dang, that’s a weird one. I just tried it on mine and it does the same thing. The .htaccess approach sounds like your best bet. You’ll need to make your old site a Fully Hosted Domain so you can upload the .htaccess file

I’m not an htaccess wiz, but try this one-liner :

EDIT: that didn’t work. Still looking…


#3

righto, thanks!
good to know I’m not the only one :slight_smile:


#4

Ok, it’s a two-liner:

RewriteEngine on
RewriteRule ^(.*)$ http://new.example.com [R=301,L]


#5

great, thanks for that, will let you know how it goes…

I chose cancel redirect in dreamhost panel and from there it decided it wanted to cancel the website from being fully hosted :frowning:

So I’ve told it to be fully hosted again and have re-inserted the redirect, not sure why, guess I forgot what I was trying to do!

I’ve uploaded the .htaccess file to old.org via ftp, it says the upload was successful but I can’t see it in the directory listing so guess it must be hidden.

So old.org redirected to new.com as before but now old.org/Main/aPage failed to do anything. So I’ve taken the redirect off again (which made dreamhost want to take the whole thing down again) and re-chose to make it fully hosted.

Will let you know what happens next!

Thanks for the help


#6

For future reference, you don’t need to cancel one type of hosting to switch to another. You can go to Manage Domains and click Edit for that domain. You’ll get the big config screen and the current setup (Redirect) will have the green “Active” arrow. Just scroll to the type of hosting you want (Fully), make sure it’s using the setting you want, then click the Fully Host This Domain button.

.htaccess is a hidden file, as are all files that start with the dot:
http://wiki.dreamhost.com/FTP#How_do_I_show_hidden_files.3F


#7

Brilliant, that seems to have worked!

The url it forwards to is: http://www.newdomain.com/?n=Main/aPage

But this seems to still work in just bringing up: http://www.newdomain.com and not a 404!

Thanks for your help!