User not logged in - login - register
Home Calendar Books School Tool Photo Gallery Message Boards Users Statistics Advertise Site Info
go to bottom | |
 Message Boards » » wordpress help Page [1]  
mcaflo
All American
1429 Posts
user info
edit post

I am experimenting with wordpress b/c I want to use it as a CMS for a site I am working on. I want to manage permanent pages and a blog using wordpress. I can't seem to figure out how to seperate the blog and permanent pages like I want to-I want the permanent pages to appear in the root directory (http://www.site.com/) and I want to blog to appear in a subdirectory (http://www.site.com/blog). Can anyone offer help?

5/30/2006 10:58:08 AM

agentlion
All American
13936 Posts
user info
edit post

ok, check out this hella-ungraceful solution I figured out while doing this site - http://nickywangsgard.com/

That entire site is managed in WP, including the static pages (profile, links), the front News page (the "news" category from the blog) and the Blog.
An easy, half-solution to your problem is to install wordpress in a "blog" directory, then put index.php in the root. But the problem there is that all your permanent pages (except for the front page) would be prefixed by "/blog/", like yoursite.com/blog/page1.

So to make it appear that there is a "blog" directory, do this:
First, the Wordpress files are installed in the root directory, as normal. From there, you can use the home.php option to create a different front page (i.e. put a home.php file in your theme directory. That file will be used for accesses to your root directory at yoursite.com)

Then make your static pages and give them slugs, so they will show up as yoursite.com/page1, yoursite.com/page2, etc.

Now here is the magic (and the major hack). If you attempt to access a file or directory through your browser that is non existant, Wordpress will default to index.php, which is where your blog information is stored. Therefore, if you don't have a 'blog' directory in your root, but then you attempt to access yoursite.com/blog, Wordpress will default to your blog!!, not home.php. So you make some links to yoursite.com/blog, your visitors use those links, and they're none the wiser to what's actually going on.
To complete the illusion, go into your Wordpress options and go to "Permalinks". Use the 'Custom Structure', and use something like "/blog/%post_id%", or "/blog/%what%ever%options%you%want%". This way, the permalinks to all yoru blog posts will also show up as yoursite.com/blog/blogpost1

If you're paying attention, you'll realize that all other mistyped URLs will go to your blog too, like yoursite.com/blogs, yoursite.com/bolgs, and yoursite.com/abcdefg
That's not really any of yoru concern. As long as your intra-site links are correct, users will have no idea what's happening behind the scenes.

Be aware that I have no idea if this is intended behavior in Wordpress, or maybe something they'll fix/change in future versions. It seems reasonable, but the argument could me made that nonexistant URLs should be redirected to home.php if one exists, not index.php, which is what this hack is relying on.
Also be sure to document what you're doing in the style.css or a README or something, or else you will forget. Just 1 week after I made that site above, I went back and completely confused myself beause i couldn't find the 'blog' directory, which i was sure was there because that's what the URL said!

.... so give it a shot and see how it works.

5/30/2006 4:00:08 PM

 Message Boards » Tech Talk » wordpress help Page [1]  
go to top | |
Admin Options : move topic | lock topic

© 2024 by The Wolf Web - All Rights Reserved.
The material located at this site is not endorsed, sponsored or provided by or on behalf of North Carolina State University.
Powered by CrazyWeb v2.38 - our disclaimer.