1

I currently have wordpress installed in its own directory and serving content for URLs beginning with /blog. So all my wordpress content is served from URLs like these:

http://www.superfantasticsite.com/blog
http://www.superfantasticsite.com/blog/permalink-something-something
http://www.superfantasticsite.com/blog/wp-admin

I would also like to serve this same stuff, but substitute /foo where /blog is and see everything just the same. For example, see same stuff with these URLs:

http://www.superfantasticsite.com/foo
http://www.superfantasticsite.com/foo/permalink-something-something
http://www.superfantasticsite.com/foo/wp-admin

And maybe later I'd even want to do /bar as well, etc.

I can easily add an Alias to the apache configs for /foo alongside the existing /blog Alias:

Alias /blog /path/to/installed/wordpress
Alias /foo /path/to/installed/wordpress

This works, in the sense that apache now serves wordpress content when the URL starts with /foo. However, wordpress does a rewrite of the URL, and the URL goes back to being http://www.superfantasticsite.com/blog/xxxxxxxxxx. I can't pinpoint where this is happening in the wp code or how to configure it to not rewrite certain paths.

How can I serve the same wordpress content using more than one /path alias?

1

1 Answer 1

1

It's generally consider pretty bad practice to have the same content at different URLs on a site and will probably damage your search engine performance. Bear in mind you'll likely need to use a rel="canonical" link tag in your page header pointing to one of the three possible URLs.

Also Wordpress stores many links directly in its database and these also will point to one of the possible locations in particular, meaning you'll never be able to preserve links on /foo/* to /foo/* if the /bar/* version of the link has been stored in the wp_posts content table in the DB.

So the further question I'm left with is why do you want to do this? What particular problem are you wanting to solve?

3
  • What if creating new content always happens via the original /blog/wp-admin? Then will all URLs stored in the db remain internally consistent? If so, then presume that any /foo/wp-admin will be undesirable and inaccessible.
    – broc.seib
    Aug 5, 2015 at 3:47
  • In short, I need /blog for blogging and /help for pages. The existing apache server is serving a ton of other app stuff from /*, except /blog and /help which use WP to render content.
    – broc.seib
    Aug 5, 2015 at 3:52
  • Then you should probably use a custom post type for your help pages and a permalink pattern to handle the different URL strategies - it doesn't sound like there's two different WP installs required here. Aug 24, 2015 at 11:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.