问题
Is there a way to map a domain name to a WordPress page?
For example, if I have mydomain.com/about/bio and mydomain.com/about/resume, could I map anotherdomain.com to the about page so I could use anotherdomain.com/bio and anotherdomain.com/resume?
Additionally, could I do it with a subdomain too?
Using the same example above, could I map about.anotherdomain.com to mydomain.com/about?
With WordPress, these aren't physical folders. They're pretty permalinks, so I'm having trouble figuring out how to make this work.
We have a Plesk control panel.
Thanks for any insight you can provide!
Edit:
The domains that I'd like to map to different parts of the URL may be registered from various providers.
回答1:
You can achive this using the .htaccess
file....
Just point the A record of your domain names to your domain. Now do the following...
RewriteCond %{HTTP_HOST} ^(www.)?mydomain.com
Rewriterule ^(.*)$ http://mydomain.com/about/bio [L]
RewriteCond %{HTTP_HOST} ^(www.)?myresumedomain.com
Rewriterule ^(.*)$ http://myresumedomain.com/about/resume [L]
RewriteCond %{HTTP_HOST} ^(www.)?anotherdomain.com
Rewriterule ^(.*)$ http://anotherdomain.com/bio [L]
回答2:
Two possibilities you can explore:
A/ Using the plesk (or other registrar), you could try a wild-card redirect such as:
anotherdomain.com -> mydomain.com/about // with "wildcard" set to "yes".
B/ If that fails, you can create a simple redirect (anotherdomain.com -> mydomain.com) and then in WordPress (assuming it's living at mydomain.com), manually redirect individual URLs using the Redirection Plugin.
You would create individual rules like:
anotherdomain.com/bio -> mydomain.com/about/bio
C/ Finally, WordPress has become so good at redirecting broken links that you might be able to get away with simply redirecting the anotherdomain.com to mydomain.com and seeing if wordpress serves the correct page when an approximate URL is entered.
anotherdomain.com -> mydomain.com // this is the redirect you create
when people type anotherdomain.com/bio, WP might serve mydomain.com/about/bio auto-magically
Good luck!
回答3:
if was me, I would do by 2 ways:
- Domain forward domain1 -> domain2/about-page
- Create a index.html and create a sub-folder on domain1 (ex: domain1.com/about) then linked to it. - Index.html will use iframe to call domain2/about.
来源:https://stackoverflow.com/questions/12505635/map-domain-to-wordpress-page