Moving to new domain, how to redirect my posts

Started by perfec2, August 03, 2012, 02:58:07 PM

Previous topic - Next topic

perfec2

I'm planing to move my forum to a new domain. After moving all files and database.
How can I redirect all posts from old one to exact url of the new one. Eg redirecting www.olddomain.com/love-relationship-romance-chat-room/can-you-date-him-or-her/      TO  www.newdomain.com/love-relationship-romance-chat-room/can-you-date-him-or-her/
also categories to it exact category of the new domain.
This is very important to me because many urls of the old domain are being pointed to by many websites and networks.

Note: I use pretty url mod.

kat

Do you still own the old domain?

If not, I suspect that you're buggered.

MrPhil

In the OLD domain's root directory, replace /.htaccess's contents with the following:
RewriteEngine On
RewriteRule ^(.*)$  http://www.newdomain.com/$1  [R=301,L]


This would send all visitors over to the new domain. If you want to send only part of the site over to the new domain, it would have to be done a little differently.

There are probably ways in your hosting control panel to do a "redirect" rather than fiddling with .htaccess yourself. As K@ said, if you no longer have access to the old domain, you're outta luck. You can't do anything from the new domain. If you still own the old domain name but not the hosting, you could probably point the old domain to the new as a "parked" domain or something. Then you could redirect visitors coming in on the old domain over to the new domain with something like
RewriteEngine On
RewriteCond  %{HTTP_HOST}  ^(www\.)?olddomain\.com  [NC]
RewriteRule  ^(.*)$  http://www.newdomain.com/$1  [R=301,L]

at the top of the new domain's /.htaccess.

perfec2

Thank you for help,  I own the old domain.
Please Would
RewriteEngine On
RewriteRule ^(.*)$  http://www.newdomain.com/$1  [R=301,L]

take users to exact posts they click from old domain  to new one in case of users that already linked to the page from external sources as I demonstrated above?

MrPhil

As long as the entire path is exactly the same (just a different domain), it will work.

perfec2

Ok, this has been noted in my plan that will be carried out after moving.

Now I have moved my database and files to the new domain, use the repair setting to set all the settings. I typed my new domain it displays fine, but when I click to go to post or category I get page not found error, please what did I miss and how to ratify this?

Note: I haven't apply redirection issue yet as that is next.

kat

Got a link to a page where we can see this happening, as guests?

perfec2

#7
This is new forum ...... click on any link in recent post or login to see.

kat

Every link is pointing to this:

/society-discussions-forums/what-have-you-done-or-planing-to-do-for-africa (Or the topic title)

Which is, clearly, very wrong.

It looks, to me, like you have a path problem.

Have you tried this?

http://wiki.simplemachines.org/smf/Repair_settings.php

Are you using PrettyURLs, by any chance?

perfec2

#9
I have run the Repair_settings.php and corrected all the paths before posting here.
Yes, I'm using pretty url

kat

Try disabling it, coz it does weird things to URLs. ;)

perfec2

How can I go about that as login part of the forum admin can't open.

Colin

Did repair_settings.php not work for you? If not you might have to manually uninstall pretty urls.
"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

perfec2

#13
This was correct, as the .htaccess was empty.

I have just applied
RewriteEngine On
RewriteRule ^(.*)$  http://www.newdomain.com/$1  [R=301,L]
It worked perfectly for me.

Please how can I  exclude just a folder?

kat

I believe you can use something like:

RewriteRule ^(dir1¦dir2¦dir3) - [L]

mrintech

Quote from: K@ on August 04, 2012, 05:38:44 PM
Try disabling it, coz it does weird things to URLs. ;)

what weird things? can your please explain? ???

kat

Well, it makes them pretty, for sure (If you're into that kinda thing). But, it doesn't, always, make them right.

It's supposed to be for SEO purposes. But, I'm not convinced that it helps, with that, one whit.

perfec2



Advertisement: