Subdomains pointing to directories on server

Subdomains pointing to directories on server

Posted by: majorchamp
Posted on: 2008-11-21 11:41:00

Hi there,

I have a unique scenario. I use WordPress as my site CMS, which creates virtual sub directories with Mod_Rewrite enabled.

meaning, http://www.site.com/work/ is a valid url, even though the folder "work' doesn't really exist as a folder in my directory.

Well, I am wanting to setup a subdomain at http://blog.site.com. When someone visits this, I want to do 2 things.

1. Forward them to http://blog.site.com/thoughts

2. Have the content for that URL being pulled from http://www.site.com/thoughts/

When I say "being pulled from", I mean I have used sub-dir remapping with dreamhost for subdomains like blah.site.com to pull its content on the server from /blah.com/whatever

What actions can I take to accomplish those 2 items above? I don't want to have to duplicate files/code, I would rather just point to the proper directories like I did for the sub-dir remapping.

Is that possible. Sorry if its confusing.

Thanks

Re: Subdomains pointing to directories on server

Posted by: sXi
Posted on: 2008-11-21 15:10:00

If SEO is important, I'd use a htaccess 301 at http://blog.site.com directing to http://blog.site.com/thoughts and another in the latter directed to http://www.site.com/thoughts/




How To Install PHP.INI / ionCube on DreamHost

Re: Subdomains pointing to directories on server

Posted by: majorchamp
Posted on: 2008-11-21 17:57:00

Well, what I am finding is with WP, in the database you have a set URL for both HOME and SITEURL, so even if I got blog.site.com/thoughts to work, it would redirect to www.site.com/thoughts everytime.

I read an article too that regarding "link juice", its better to have a blog on the same host/domain site a subdomain "is" looked at differently then a subdirectory.

Tags: proper directoriesdreamhostsubdomainrewritecms