Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-10-22 11:43:52

inkh
New Member
From: Stockholm, Sweden
Registered: 2005-04-07
Posts: 3

Subdomain for category

I use Textpattern for all of my site, with galleries and everything. Now I figured it would be cool if I could have the blog-part on a subdomain of it’s own, ie:

Before: mydomain.com/blog
After: blog.mydomain.com

I tried some mod_rewrite but right now I’m trying to make it work with virtual hosts and DirectoryIndex:

ServerName blog.mydomain.com
DocumentRoot /var/www/localhost/htdocs/mydomain/
DirectoryIndex index.php?s=blog

This does not work.

Anyone tried something similar, or have ideas of how to solve it?

Thanks
Andreas

Last edited by inkh (2005-10-22 11:46:06)

Offline

#2 2005-10-22 12:20:40

Jeremie
Member
From: Provence, France
Registered: 2004-08-11
Posts: 1,578
Website

Re: Subdomain for category

You would need to hack TXP to generate new URLs.

But you know, subdomains have a meaning. Their not here just to be “cool” :)

Offline

#3 2005-10-22 13:03:50

inkh
New Member
From: Stockholm, Sweden
Registered: 2005-04-07
Posts: 3

Re: Subdomain for category

Hey, I wanna be “cool”, okay? :-)

Why would I need to generate new URL’s? I’ve got full access to the webserver and everything, it looks to me that somehow I would be able to do this transformation so it looks like my example, but still works as usual with textpattern.

Hm, I could perhaps do a blog.php-page that loads up the index.php?s=blog page? Then the DirectoryIndex would work as usual, hmm!

Offline

#4 2005-10-22 14:17:57

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Subdomain for category

This line in .htaccess:

<pre>Redirect /blog http://blog.mydomain.com</pre>

works for me. But I’m using the subdomain for a different site with it’s own txp install.

Offline

#5 2005-10-22 17:03:39

inkh
New Member
From: Stockholm, Sweden
Registered: 2005-04-07
Posts: 3

Re: Subdomain for category

Hi!
Got it working now. I set up a Virtualhost, and then this:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^blogg\.mydomain\.com$ [NC]
RewriteRule ^(.*)$ \/index.php?s=blog

Works like a charm. Thanks for your suggestions all.

Offline

Board footer

Powered by FluxBB