Mobile app version of vmapp.org
Login or Join
Tiffany637

: How do I redirect Pages to the Subdomain with same URL Format? How do I redirect Pages from the main site with 404 Status to the Subdomain with same URL Structure? This for example: https://www.example.com/rent

@Tiffany637

Posted in: #Redirects #Wordpress

How do I redirect Pages from the main site with 404 Status to the Subdomain with same URL Structure?

This for example:
www.example.com/rent

this returns a 404 Error and must be redirected to:
subdomain.example.com/rent

Is this possible on WordPress? If it is how can we do it?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Tiffany637

2 Comments

Sorted by latest first Latest Oldest Best

 

@Megan663

There are several ways to add redirects for specific pages to a WordPress blog. There are plugins and extensions to WordPress that will allow redirects. www.wpbeginner.com/beginners-guide/beginners-guide-to-creating-redirects-in-wordpress/ recommends two of them.

I would take the approach of editing the .htaccess file and just putting the redirect in there:

Redirect permanent /rent subdomain.example.com/rent

10% popularity Vote Up Vote Down


 

@LarsenBagley505

Do this in .htaccess file in main subdirectory

RewriteEngine On
RewriteCond %{HTTP_HOST} example.com
RewriteRule ^(.*)$ sub.example.com/sub [R=permanent,L]

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme