admin管理员组

文章数量:1122832

How can I use .htaccess to rewrite a a page on a subdomain to a page on the parent? (E.g. people visiting mysite/landingpage will see the content from dev.mysite/landingpage)?

Ive been working to redesign a WordPress site, using a dev.mysite subdomain. The site isn't ready to replace the live WP site yet (mysite) but I need to map one of the pages to the old domain and make it public. Since all the work (template,database,etc) is on the subdomain, I can't just import the page to the old domain, so I seemingly need to use mod_rewrite, which is way beyond my skill level. Also, since its two different WP Installations (not multisite), would I use the domain .htaccess file or the subdomain .htaccess file?

Thanks!

How can I use .htaccess to rewrite a a page on a subdomain to a page on the parent? (E.g. people visiting mysite.com/landingpage will see the content from dev.mysite.com/landingpage)?

Ive been working to redesign a WordPress site, using a dev.mysite.com subdomain. The site isn't ready to replace the live WP site yet (mysite.com) but I need to map one of the pages to the old domain and make it public. Since all the work (template,database,etc) is on the subdomain, I can't just import the page to the old domain, so I seemingly need to use mod_rewrite, which is way beyond my skill level. Also, since its two different WP Installations (not multisite), would I use the domain .htaccess file or the subdomain .htaccess file?

Thanks!

Share Improve this question edited Dec 9, 2016 at 22:16 Self Designs 3776 silver badges17 bronze badges asked Dec 9, 2016 at 20:24 Dovid LevineDovid Levine 416 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 0

If you use the main domain .htaccess file when people go onto the page you want to display on the sub domain it will change the url link to dev.mysite.com I am not sure if that is the best approach but if you want to do it that way you would have to use the main domains .htaccess to redirect to the subdomain.

Another option could be export the page's data with a WordPress exporting plugin. A search on the website led me to this one which may be of some use. https://en-gb.wordpress.org/plugins/wp-exporter/

You seem to be speaking of URL masking. Please refer here and here for examples.

A visitor to example.com/mypage can be shown example.net/mypage while seeing example.com/mypage in the address bar. Not sure how you'd handle the links from example.net/mypage back to the main site instead of the development site, but that wasn't part of the question.

本文标签: htaccessRewriting a subdomain page on one WordPress installation to a parent domain on another