Skip to content

Instantly share code, notes, and snippets.

@Ashkanph
Created November 18, 2018 08:07
Show Gist options
  • Save Ashkanph/f5877041e6a90baa634bda61ffb4f1e7 to your computer and use it in GitHub Desktop.
Save Ashkanph/f5877041e6a90baa634bda61ffb4f1e7 to your computer and use it in GitHub Desktop.
Change wordpress api to the subdomain

Change wordpress api to the subdomain

<IfModule mod_rewrite.c>
# Redirecting dynamic subdomain urls to wp api
RewriteEngine On
RewriteCond %{HTTP_HOST} ^subdomain.maindomain.com$ [NC]
RewriteRule ^(.*)$ https://www.maindomain.com/wp-json%{REQUEST_URI} [R=301,NC,L,QSA]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment