1

There is a custom post type by the name of code parked on a domain: sample.com. The redirect of the whole custom posts of code CPT to the custom posts of code CPT of www.someanotherdomain.com

.htaccess has such a capability?

Can we accomplish this? Is this a WP inbuilt feature?

URL Format:

www.sample.com/code/how-php-works/ for example.

all post of that CPT to:

www.someotherdomain.com/code/how-php-works/ for example.

6
  • 1
    Please include the URL format you are referring to. (btw .htaccess has 2 cs)
    – MrWhite
    Commented Feb 3, 2020 at 8:54
  • Includes, the URL format sir.
    – WordCent
    Commented Feb 3, 2020 at 9:09
  • You want to redirect this particular post type..Right? Commented Feb 3, 2020 at 9:38
  • Is someotherdomain.com on a different server?
    – MrWhite
    Commented Feb 3, 2020 at 9:54
  • Yes, on completely different system/server.
    – WordCent
    Commented Feb 3, 2020 at 10:18

1 Answer 1

0

Try something like the following at the top of your .htaccess file at sample.com:

RewriteEngine On

RewriteRule ^code/. https://www.someotherdomain.com%{REQUEST_URI} [R,L]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.