[wp-hackers] Putting post into /blog/

scribu scribu at gmail.com
Sat Nov 28 15:20:25 UTC 2009


On Sat, Nov 28, 2009 at 4:46 PM, Mike Schinkel
<mikeschinkel at newclarity.net>wrote:

> Here's another URL related issue.  For the longest time I've wanted to move
> everything blog related (i.e. not "Pages") including tags, categories, and
> posts under the "/blog/" URL path.  Let me explain with hypothetical URLs:
>
> example.com/products/
> example.com/support/
> example.com/about/
> example.com/contact/
> example.com/blog/
> example.com/blog/category/{category_slug}/<http://example.com/blog/category/%7Bcategory_slug%7D/>
> example.com/blog/tag/{tag_slug}/<http://example.com/blog/tag/%7Btag_slug%7D/>
> example.com/blog/{year}/{month}/{post_slug}/<http://example.com/blog/%7Byear%7D/%7Bmonth%7D/%7Bpost_slug%7D/>
>
> You'd think this would be easy but unfortunately it has been a very elusive
> beast.
>

I've encountered this problem before.

Something that kind of works is adding /blog/ in the post permalink
structure, in the admin:

/blog/%year%/...




> I met Matt at WordCamp Birmingham and he proposed a(n ugly) hack. The hack
> required moving everything index.php and wp-config.php into a /wp/
> subdirectory and then in index.php I changed the require link to:
>
> require('./wp/wp-blog-header.php');
>
> And added this in wp-config.php:
>
> define('WP_SITEURL', 'http://example.com/wp' <http://example.com/wp%27>);
>
> It worked, except for it broke the media uploads (I didn't learn that until
> much later, and who knows what else it breaks?)
>

I wouldn't call that a dirty hack, but it doesn't adress your issue.

It simply allows you to have all the WP files in a different directory.


-- 
http://scribu.net


More information about the wp-hackers mailing list