Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-01-04 23:14:17

Michael
Member
From: Vienna/Austria
Registered: 2004-03-25
Posts: 147
Website

...modify .htaccess to do this?

Hi!

How do I have to modify my .htaccess-file to do this:

blog.domain.com points on TXP’s index.php

domain.com and
www.domain.com point on the section “official”

How to do this?

M.

Offline

#2 2006-01-04 23:45:58

NyteOwl
Member
From: Nova Scotia, Canada
Registered: 2005-09-24
Posts: 539

Re: ...modify .htaccess to do this?

I think this should work, but I’m still experimenting with TXP myself. In your root .htaccess file use the following:
<br />

<h4>for subdomain redirect</h4>

<code>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^blog.domain.com$
RewriteRule ^(.*)$ http://www.domain.com/<INSERT TXP PATH HERE>/index.php [R=301,L]
</code>

<h4>for dynamic urls</h4>

<code>
RewriteCond %{HTTP_HOST} ^domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.domain.com$
RewriteRule ^(.*)$ http://www.domain.com/<INSERT TXP PATH HERE>/index.php?s=“official” [R=301,L]
</code>

<h4>for “clean” urls</h4>

<code>
RewriteCond %{HTTP_HOST} ^domain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.domain.com$
RewriteRule ^(.*)$ http://www.domain.com/<INSERT TXP PATH HERE>/<INSERT SECTION NAME HERE>/ [R=301,L]
</code>

<br />

Last edited by NyteOwl (2006-01-04 23:53:31)


Obsolescence is just a lack of imagination. / 36-bits Forever! / #include <disclaimer.h>;

Offline

Board footer

Powered by FluxBB