Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2016-03-02 12:22:26

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Creating sub-domain URIs. How?

Can someone explain how (or what is needed) to make this…

domain.tld/sub

Into a working URL like this…

sub.domain.tld

I.e., I could post that second link anywhere online as a URI, people could follow it, and see that same URL structure in their browser.

I’m guessing this involves zone file changes, but I’ve never been able to figure it out. Can someone clear the smog once and for all?

Offline

#2 2016-03-02 12:29:15

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: Creating sub-domain URIs. How?

That first question is independent of Txp.

But now let’s introduce that factor into the equation. What if we’re not talking about separate sub-directories (where you could install separate systems/projects), but simply sub-folders in a Txp install location… Could you still create such URIs like that?

E.g. if you had….

txpinstall.tld/sub

Could it be forced as…

sub.txpinstall.tld

?

I’m thinking this is where it gets impossible, right?

Offline

#3 2016-03-02 14:58:46

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,054
Website GitHub Mastodon Twitter

Re: Creating sub-domain URIs. How?

I remember there was an htaccess rule. Somebody correct me please.

RewriteEngine on
RewriteBase /
RewriteRule ^/sub/(.*)$ http://sub.domain.tld/$1 [R=301,L]

and here is another one I found on the net

RewriteEngine On

RewriteCond %{HTTP_HOST} ^(www\.)?example.com$ [NC]
RewriteRule ^/?market/(.*)$ http://market.example.com/$1 [L,R=301]

RewriteCond %{HTTP_HOST} ^(www\.)?example.com$ [NC]
RewriteRule ^/?buddies/(.*)$ http://buddies.example.com/$1 [L,R=301]

RewriteCond %{HTTP_HOST} ^(www\.)?example.com$ [NC]
RewriteRule ^/?bazaar/(.*)$ http://bazaar.example.com/$1 [L,R=301]

Last edited by colak (2016-03-02 15:05:12)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#4 2016-03-02 16:01:16

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: Creating sub-domain URIs. How?

So it doesn’t involve zone files and DNS mapping magic?! I’ve been led astray.

Offline

#5 2016-03-02 16:31:50

Algaris
Member
From: England
Registered: 2006-01-27
Posts: 548

Re: Creating sub-domain URIs. How?

Destry wrote #298119:

So it doesn’t involve zone files and DNS mapping magic?! I’ve been led astray.

That’s the way I usually go about it myself. I make all the changes in the control panel for my domain name.

I guess there’s more than one way to go about creating sub-domain URLs

Offline

#6 2016-03-02 17:09:24

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: Creating sub-domain URIs. How?

Algaris, I think for my first situation at top it’s probably better to do it at the zone file level like you do, because there may not always be an .htaccess file involved.

Could you provide a little extract/dummy example of zone records showing how you do that? Or have a good link that demos it somewhere? Doesn’t it require having multiple IP addresses or something?

Offline

#7 2016-03-02 18:26:08

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: Creating sub-domain URIs. How?

Never mind. Don’t trouble yourself. I think we’ve got it figured out when the time comes.

Offline

Board footer

Powered by FluxBB