php - Multiple hostnames for a single Wordpress blog to control displayed post categories
Get the solution ↓↓↓Solution:
Thomas - there are a few ways you could achieve this. If you want a solution that doesn't involve setting up a separate WP network for each hostname (assuming you're using WP 3.1), a neat way might be to rewrite the URL at the web server. WP already requires you to cofigure rewrite rules for pretty URL support, so there's no reason why you could internally mapcategory.example.com
intowww.example.com/category
. If you made all your site's links relative, this could work reasonably well.
Otherwise, I'd create a network for each hostname, and write a multi-site plugin that adjusts the WP_Query for any request received on a 'category' network, to retrieve posts from the main blog with a category filter. But you'd probably end up fighting WP every step of the way :-)
There may be a neater solution.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: closed without sending a request; it was probably just an unused speculative preconnection
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.