Link to home
Start Free TrialLog in
Avatar of mkc451
mkc451Flag for United States of America

asked on

Trying to a redirect when both sites in the same domain

Trying to move a website -- same domain though -- xxxxx.com/Wordpress is the developmental site, new site at a new host is: xxxxx.com only. I can't get a redirect to work, not sure what is missing. I am using web tool redirection plugin  -- since the old web site is the same domain, I am not sure what to do? Any direction.
Avatar of David Favor
David Favor
Flag of United States of America image

Using a Web redirection tool will cause massive problems.

Suggested migration sequence.

1) Use a standard backup plugin like Duplicator or BackupBuddy.

2) If you've used redirection it's highly likely you're now in a world of hurt, because you have a 301 cached in your browser, which will stay in effect till the sun goes nova (forever), so before you do anything else, you'll have to...

a) Destroy any redirect related code/config.

b) Clear the redirect from your browser, which can be complex. Sometimes a simple as clear all cached pages. Sometimes not.

3) Best publish your actual URL, so you can be provided correct migration instructions.

Without a correct URL, you'll have to sort out all instruction failures to determine if they're related to your redirect code/config.

4) Future: Never using a folder/directory/nested WordPress install, as these don't work like you think + can cause near impossible to debug problems. To numerous to go into.

5) Make a backup of your dev site (xxxxx.com/Wordpress) using the #1 backup plugin you installed.

6) Copy off the .php installer file + .zip site backup somewhere safe.

7) Destroy all files related to xxxxx.com, so you have an empty directory only.

Also destroy the old database, else you'll now have a stray/orphan database.

8) Now get HTTPS + HTTP2 working for xxxxx.com, so your empty directory serves correctly.

9) Now upload your #6 installer + backup files to the xxxxx.com site's empty directory.

10) Create an empty data base.

11) Run the installer .php file + follow instructions.

12) Few seconds later you'll have a working site.
Note: Also best you make a backup of your current site before you destroy related files + database.

Note: Doing site migrations/renames like this are complex. Best to always name your dev site as dev.xxxxx.com or staging.xxxxx.com with well named database.

I do this by naming the database to match the site, xxxxx_dev as an example.
.htaccess file to redirect.
Avatar of mkc451

ASKER

I was able to resolve this -- using just the pathways.. ^/wordpress/*  to ^/*  .. all under the same domain xxxxx.com ... seems to work fine.
What you describe above, will corrupt your database (if you have 2x WordPress install file sets) or work incorrectly (subtle breakage).

https://www.experts-exchange.com/questions/29167303/How-To-Re-direct-all-Traffic-to-WWW-Apache.html

Open in new window

provides Apache config for one site.

For 2nd site, redirect the your final/terminal/real site.

Publish your actual URLs for best comments.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.