Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2005-10-01 20:57:19
- pin007
- New Member
- From: Prague, Czech Republic
- Registered: 2005-02-16
- Posts: 2
Sections as Subdomains in TXP v 4.0.1
Hi all,
old song, I want to use subdomains as TXP sections (www.domain.com/about -> about.domain.com and so on). I have tried this trick but it ended with Textpattern Error “404 Page not found”.
Has anyone working copy of 4.0.1 version with this feature/hack/solution :-) ?
Thanks a lot.
Tonda
Offline
#2 2005-10-04 02:21:59
- joseph
- New Member
- Registered: 2005-08-02
- Posts: 4
Re: Sections as Subdomains in TXP v 4.0.1
I haven’t tried this, but it seems doable. Here’s my theory on how it would work.. YMMV…
Say my httpdocs directory is the root of my domain, and I have txp installed there (i.e. the web relative path http://mydomain.com/ is where index.php lies). This is a requirement.. it won’t work for secondary domains already hosted in subdirectories. So, you add a subdomain, which feeds from http://mydomain.com/subdir, which is accessed through http://subdir.mydomain.com. Apache just does a fetch from that directory, relative to the web root, behind the scenes. This means that .htaccess is still used, so if you have clean URL’s working, just delete the subdir directory itself.
So, you browse to subdir.mydomain.com, and apache goes off to find mydomain.com/subdir. The directory is absent, so it falls back on .htaccess, and finds your rewrite rule. The rewrite rule points to the index.php, and the data is read.
Now, this can cause havoc if you want to actually place data in this virtual subdirectory, because no actual subdirectory exists. In this case you’ll have to work around it, using root-relative datapaths for images and other linkable files. This is no different than working with existing clean URL’s.
Anyway, hope this helps.
Offline
Pages: 1