Correcting WordPress folder to subdomain URL changes using redirection

by | Jan 7, 2022 | Domain Names, Search Engine Optimization (SEO), Technical Help, Web Hosting, WordPress

Sometimes we might go from a site located in a folder off the root of a site to a subdomain or site of its own in a standalone environment.

Why would we want to do this?

There are some advantages for separating out your sub-sites into separate sites:

Security: With sites separated out, each is actually more secure. That stems from the fact that should something become compromised (when all the information is in a single site), everything becomes compromised. From a security standpoint, if bad actors get into a site they are usually only in the one site. The risk of bad actors get into your other sites increases exponentially if your administrative accesses are the same. Since we can save our passwords in our browsers so easily, there is no reason to use the same password over multiple sites. That’s asking for trouble.

Organization: Material can be organized and focused better for each of your sites. I have spoken for many years about the concept of SEO dilution. When a website focuses precisely on a specific product or idea it is more apt to be seen by search engines as an authority on that product or idea. This is one of the building blocks of search engine optimization.

Speed: Separated sites are able to operate faster. Websites are allocated machine resources by the operating systems of the servers upon which they reside. Each separate site has more resources than if they are all together in a single site space. There is always a lot of hype about speed on the web. Yes, speed is important in that no one wants to wait a long time when viewing a website. Running our own web servers at CharlesWorks as well as using external web servers have shown us that what rules is the content of the site.

The Syntax for Redirections

Redirecting website content mostly becomes a problem when a site has had its pages listed in search engines. For instance, in the solutions listed below there was a primary website that branched off into several other independent sites based upon the city. In this example, one of the “city” sites was being moved from:

https://example.com/cityname/

to

https://cityname.example.com

or, it could have been moved to:

https://example.net

The following code example will solve this when using John Godley’s Redirection Plugin in the Regex mode. Obviously, make sure the Redirection plugin is installed and active on your website. Note the following:

Redirection code placement: This redirection code must be placed in the original site’s URL

Folder cannot exist: In order to work, the folder the site was previously in must be deleted or a 403 error will occur

It’s pretty easy to get this working.

You will have to be logged in with administrative access in the WordPress dashboard. Navigate to:
Tools > Redirection
Then click on the Add New button after Redirections in the upper left

Now just modify the original boxes (Source URL, choose Regex and Ignore Case, and Target URL) to reflect the correct original URL site descriptor and target URL:

/cityname(.*)

https://cityname.example.com/$1

or, if this is the case:

/cityname(.*)

https://example.net/$1

The “(.*)” coupled with the corresponding “/$1” in the above code retains the remainder of the URL so the redirection to specific pages that search engines have retained will still get site visitors to the correct newly addressed information.

This example is similar, and fixes “feeds” that were accessed at the original URL. In this example the slug names were changed to reflect the new site the posts were now in:

/the-old-tip-site-(.*)/feed/

/latest-and-greatest-tips-$1/feed/

As with any changes you make, be sure to test them! Testing is done best with a separate browser that you haven’t accessed the site you are dealing with recently. You may also have to clear your computer’s cache.

CLICK HERE to find your domain name!   CLICK HERE to transfer your domain name!

Resource Categories

Archives

Tags

24 hour (1) Accounting (1) Advertising (9) AdWare (1) Alex Johnson (2) Alignment (1) Android (2) Anti-Virus (1) Antivirus (1) Antrim Computer Repair and Service (3) APC Back-UPS (1) Appearance (2) Apple Mail (4) Apple Mobile Mail (2) Attachments (1) Audit (1) Authorized (1) Autoresponder (5) Availability (1) Backups (1) Badges (3) Bank Account (1) Bank Statement (1) Battery Backup (2) Bob Hill (1) Bookkeeper (1) Branding (5) Budget (2) Business (19) Business Management (1) Catalog (1) Charles Oropallo (1) CharlesWorks (37) Cherryl Jensen (1) Chrome (1) Cloud (1) Code (2) Communicating (1) Competition (1) Computer (2) Computer Cache (1) Computer Security (1) Constant Contact (1) Consultation (1) Contact Information (2) Content (1) Content Management (20) Content Management System (1) Copiers (1) Copy Machine (1) Coronavirus (2) Courteous (1) COVID-19 (2) Credibility (6) Credit Card (1) Credit Card Processing (1) CSS (8) Customer Service (2) Design (39) Design Expertise (1) Desktop (1) Dialup (1) DirectAdmin (1) Directions (1) DIVI (4) DNS (1) Do-it-Yourself (1) Documentation (1) Domains (17) Domain Transfers (5) E-Commerce (1) Email (63) Email Lists (4) Email Management (2) Email marketing (3) Etiquette (3) Eudora 6 (1) Exchange (1) Expanding (1) Facebook (1) Financial (1) Finish (1) Firefox (1) Fonts (1) Forms (2) Forms Protection (1) Fraud (2) Galaxy S4 (1) General Info (1) Gmail (1) GoDaddy (1) Google (1) Google Adwords Certified Partner (1) Google Chrome (2) Groups (1) Happy Holidays (1) Hardware Help (1) Hill Specialty Networks (1) Hosting (1) Images (1) IMAP (1) include (1) Infected (1) Information (22) insert pages (1) install (1) Internet Browsing Errors (1) Internet Consultant (1) Internet Explorer (1) Keywords (2) Laptop (1) Legibility (1) Linux (5) Logging on (1) Macintosh (1) Mail 6.0 (1) Mail 2011 (2) Make-Over (1) Malicious (1) Malware (1) Marketing (6) Matt Burke (3) MDaemon (3) MelbourneIT (2) menu (1) Merchant (1) meta (1) Microsoft (1) Microsoft Edge (1) Microsoft Hosted Exchange (5) Microsoft Live (2) Mobile Email Setup (1) Monadnock Region (1) Mozilla Firefox (2) MySQL (1) Nathan Wesley (1) Netscape (1) Netscape Messenger (1) Office Copiers (1) OfficeLive (1) Online (1) Outlook (9) Outlook 2010 (2) Outlook Express (1) PayPal (1) Pay Per Click (2) PC (1) Personal (1) Peter Harris (1) Peter Harris Creative (1) Phishing (2) PHP (2) pixel (1) plugins (1) Pop Email (1) Popularity (1) Portfolio (1) Power Grid Failure (1) PPC (1) Prevent Fraud (1) Privacy (1) Private (1) Product (6) Professional (4) Projects (2) Protect (1) Protection (1) Quality (2) QuickBooks (1) Reconciliation (1) Reduce Risk (1) Register (1) Reliability (2) Renew (1) Reseller (2) Resolution (1) Restrict User Access (1) Results (1) Review (2) Risk (1) Robin Snow (1) Roundcube (1) Safe (1) Samsung (2) Scam (11) Scammer (10) Search (1) Search and Replace (1) Search Engine Optimization (6) Search Engines (9) Security (16) Security Risk (1) Selling (1) SEO (1) Servers (2) Service (8) Shopping Cart (1) Site (1) SmarterMail (9) Social Engineering (1) Social Networking (1) Software (1) Solutions for Today (1) Spam (1) Spam Filtering (15) Spammer (1) Spyware (2) SquirrelMail (1) SSL (7) Statistics (2) Stats (2) Stone Pond Technology (1) Storage (1) Support (1) Tablet (1) Target Market (1) Technical Help (1) Testimonials (1) The CW Corner (1) Thom Little (1) Thom Little Associates (1) Thunderbird (3) Thunderbird 10 (2) TLD (1) Topic (1) Top Level Domains (3) Transaction (2) Transfer Data (1) Transfer Funds (1) Typography (1) Update (2) Uploading (1) UPS System (2) Up to Date (1) Virus (2) Viruses (1) Vista (1) Web (1) Web-Over (1) Web Development (79) Web Hoster (1) Web Hosting (2) Web Hosting Company (1) Webmail (8) Web Mail (1) Webmaster (10) Web Presence (23) Website (95) Website Development (1) Web Stats (1) Web terms (1) Web Writing (1) Windows 7 (2) Windows Mail (5) Windows XP (1) WooCommerce (2) WordPress (70) WordPress Updates (1) Working Remote (2) Writing (1) youtube (1)