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 badges2 Answers
Reset to default 0If 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
版权声明:本文标题:htaccess - Rewriting a subdomain page on one WordPress installation to a parent domain on another 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736291125a1928658.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论