Welcome, Guest. Please login or register.
Did you miss your activation email?
February 13, 2012, 03:51:08 AM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite.
149700 Posts in 21103 Topics by 7538 Members
Latest Member: ionline
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Landingspage - Subdomainmodule  (Read 902 times)
Paradontax

Offline Offline

Posts: 55



« on: October 28, 2010, 01:10:43 PM »

Hello Bakers!

Is there a module that lets you create a newpage that creates a sub domain like johndo.websitebaker s.nl automatically?

I want some landings pages of my website that i can make in the WB backend.

Greetz!
Leo

Logged
chio
WebsiteBaker Org e.V.

Offline Offline

Posts: 2264


« Reply #1 on: October 28, 2010, 05:54:33 PM »

This isnt a thing from WebsiteBaker - you have to use Apache url rewite engine (mod_rewrite)

You have to change
http://subdomain.domain.com to http://domain.com/?p=subdomain
and then modify your index.php to $_GET the p parameter and query.

but the most tricky thing is: you also have to rewrite all internal links. "Topics" might be a good module to create those spam pages and link to them.

One thing: Subdomains are completely OUT, Google doesnt want them anymore.

EDIT: Sorry, it isnt that simple; you need a Dynamic Mass VirtualHosting to generate all Subdomans on the fly
« Last Edit: October 28, 2010, 06:05:24 PM by chio » Logged

*weg*
DarkViper
Development Team
*****
Offline Offline

Posts: 1053


« Reply #2 on: October 28, 2010, 06:13:13 PM »

it is not possible to create a real subdomain by WebsiteBaker on normal way.
the only thing you can do is to fake a subdomain..  as chio describe.

Creating a subdomain is part of the Webspacemanager your provider.

If your webserver is managed by Plesk and your provider allow the use of the XML-RPC API, then you can code an interface to manage your Server/Webspace by your own WebsiteBaker-Module.
Logged

Anleitungen lesen und selber nachdenken ist anstrengend...  Da lass ich doch lieber andere für mich denken...

In 1984:  Nineteen Eighty-Four is a unrealistic utopia!!
In 2012:  Nineteen Eighty-Four is a little piece only of our reality!!
Paradontax

Offline Offline

Posts: 55



« Reply #3 on: October 29, 2010, 06:34:50 PM »

 TNX 4 the reply! grin

"One thing: Subdomains are completely OUT, Google doesnt want them anymore."

Is it useful to create this module or is it a waste of time?

Greetz
Leo
Logged
chio
WebsiteBaker Org e.V.

Offline Offline

Posts: 2264


« Reply #4 on: October 29, 2010, 06:55:51 PM »

You might use Google to find an answer: Search for something (you could buy) and count the subdomains in the SERPs...
Logged

*weg*
DarkViper
Development Team
*****
Offline Offline

Posts: 1053


« Reply #5 on: October 29, 2010, 10:38:38 PM »

Quote
Is it useful to create this module or is it a waste of time?

It's very useful, as i see at my own one.  wink

BUT: you need a very high knowledge about handling of servers and good experience in coding such interfaces.
Take care: one bug in your code can destroy the whole configuration of your server and all of the data gone lost. Also it's difficult to protect the interface against intruders.
Logged

Anleitungen lesen und selber nachdenken ist anstrengend...  Da lass ich doch lieber andere für mich denken...

In 1984:  Nineteen Eighty-Four is a unrealistic utopia!!
In 2012:  Nineteen Eighty-Four is a little piece only of our reality!!
Sgt.Nops

Offline Offline

Posts: 196


« Reply #6 on: October 30, 2010, 10:20:45 AM »

I always had some interest in creating such a module, as its very usefule for domain parking.
Let see if we can get the pieces together.

First we need something to lead all domains and maybe subdomains straight to your webspace.
Then we can use websitebaker to sort em out.
As far as i know   .htacces  can only do redirects(301/302) over (sub)domain boundaries.
so .htaccess is useless for this task.

Ok, Step one.
Something to get all your domains and subdomains  straight to your webspace .
On a root server this is done via apache config :
Code:
<VirtualHost *:80>
    DocumentRoot /web/www.domain.de/incoming
    ServerName domain.de
    ServerAlias *.domain.de domain2.de *.domain2.de domain3.de *.domain3.de
    ErrorLog /web/www.immerbeiderarbeit.de/logs/httpd-error.log
    CustomLog /web/www.immerbeiderarbeit.de/logs/httpd-access.log combined
    CustomLog /web/www.immerbeiderarbeit.de/logs/httpd-access.log referer
    CustomLog /web/www.immerbeiderarbeit.de/logs/httpd-access.log agent
</VirtualHost>
You may notice one interesting thing about subdomains:
Apache accepts wildcards ! So all subdomains go straight to your webspace (www.domain.de msysub.domain.de abcdef.domain.de  all.domain.de..... endless possibilities)

Some, but not all providers offer wildcard support in their maintainance interfaces too. So you need a provider that allows access to apache config or accepts wildcard domains inside of his maintainance interface. If you dont have that, the story ends here , or you have to create all those subdomains manually. tongue

Step two
Now that all Domains and Subdomains go straight to our webspace i see only 1 way of coming closer to our goal
1. modify WB so i displays different content depending on $_SERVER[SERVER_NAME]

Now we need help from some  WB experts. Is it possible to modify page ID depending on a Server variable , somwhere early inside of WB ?

I am pretty sure its possible as WB displays different pages as starting page depending on what page is on top inside of pages interface.

Just had the Idea if its possible do abuse the language system for this , so maybe create a language for each extra page and set the Language depending on $_SERVER[SERVER_NAME].
The Language way would have the advantage, that you can have a full scale page instead of just one single landingpage.

Maybe there are several other ways of doing this and maybe DarkViper enlights us how he has done it  i would easily take the risk of destroying my server config, as i normally backup all stuff berfore doing any experiments .
Or maybe i simply use my local XAMPP for experimenting.


Logged

Es gibt keine dummen Fragen, nur dumme Antworten.
DarkViper
Development Team
*****
Offline Offline

Posts: 1053


« Reply #7 on: October 30, 2010, 01:37:50 PM »

Quote
Now we need help from some  WB experts. Is it possible to modify page ID depending on a Server variable , somwhere early inside of WB ?

It's not needed, because from next release WB never use hardcoded WB_URL/ADMIN_URL. These values in future will be auto detect. So it is not heavy to use these values to select the needed pages or subtree in page hierarchy.

The second part:
To maintain a Plesk-controlled webserver you need the Parallels Plesk Panel 9.5 API RPC Protocol Developer Guide. Here you can find any needed information.
To control a WAMPP/XAMPP-server, you need a demon, running as root(or with root rights) and additional a PHP Frontend to control that demon. The preferred language to code a really fast demon is C++.  It's not possible to use a PHP-Frontend only. (I wrote in my last post, that's not easy to do..  wink)
Logged

Anleitungen lesen und selber nachdenken ist anstrengend...  Da lass ich doch lieber andere für mich denken...

In 1984:  Nineteen Eighty-Four is a unrealistic utopia!!
In 2012:  Nineteen Eighty-Four is a little piece only of our reality!!
Sgt.Nops

Offline Offline

Posts: 196


« Reply #8 on: October 30, 2010, 04:09:39 PM »

I prefer to use ssh console to maintain my server  grin

I took a look into WB startup and found it very easy to solve that problem in a quick and dirty way.

First you need to tell your webserver to connect all your domains and subdomains straight to your webspace.
Thats the part i discussed in my previous posting.

Then we need to modify config.php  to always use the same path like the (sub)domain its called from.
(I guess that what  upcomming WB version does anyway)
config.php:
Code:
define('WB_PATH', dirname(__FILE__));
define('WB_URL', 'http://domain.de/');
define('ADMIN_PATH', WB_PATH.'/admin');
define('ADMIN_URL', 'http://domain.de/admin');
to
Code:
define('WB_PATH', dirname(__FILE__));
define('WB_URL', 'http://'.$_SERVER[SERVER_NAME]);
define('ADMIN_PATH', WB_PATH.'/admin');
define('ADMIN_URL', 'http://'.$_SERVER[SERVER_NAME].'/admin');

Second step: Add a switch in index.php right at the beginning.

Code:
switch ($_SERVER[SERVER_NAME]) {
case "eins.domain.de":
       $page_id=1;
         break;
case "zwei.domain.de":
       $page_id=2;
         break;
case "drei.domain.de":
       $page_id=4;
         break;
case "another-domain.de":
       $page_id=5;
         break;
}

If you want to have different page trees for each subdomain you need to use the same menu tactic thats used for different Languages (tell showmenue() or showmenu2() not to display the upper level of your page tree)

I did a few test and it looks like it runns whithout any problems.
Any questions ?
« Last Edit: October 30, 2010, 04:13:11 PM by Sgt.Nops » Logged

Es gibt keine dummen Fragen, nur dumme Antworten.
DarkViper
Development Team
*****
Offline Offline

Posts: 1053


« Reply #9 on: October 30, 2010, 05:11:39 PM »

this works....   as long  you have no other pages as the ones defined in your switch.
the hardcoded $page_id=n; will overwrite any accessfile setting...
Logged

Anleitungen lesen und selber nachdenken ist anstrengend...  Da lass ich doch lieber andere für mich denken...

In 1984:  Nineteen Eighty-Four is a unrealistic utopia!!
In 2012:  Nineteen Eighty-Four is a little piece only of our reality!!
Sgt.Nops

Offline Offline

Posts: 196


« Reply #10 on: October 30, 2010, 05:58:13 PM »

Schould be better now  cheesy
Code:
if ($_SERVER[REQUEST_URI]=="/"){
switch ($_SERVER[SERVER_NAME]) {
case "eins.immerbeiderarbeit.de":
$page_id=1;
break;
case "zwei.immerbeiderarbeit.de":
$page_id=2;
break;
case "drei.immerbeiderarbeit.de":
$page_id=4;
break;
}
}
Logged

Es gibt keine dummen Fragen, nur dumme Antworten.
Sgt.Nops

Offline Offline

Posts: 196


« Reply #11 on: October 30, 2010, 11:24:58 PM »

Btw. someone ever looked at SEDO.com one of germays biggest domain parking services?

The use javascript redirects  shocked

So if you need to park your domains , never use SEDO or you loose your ranking in goolge faster than you can cry for help. 
Logged

Es gibt keine dummen Fragen, nur dumme Antworten.
NorHei
Forum administrator
*****
Offline Offline

Posts: 466


WWW
« Reply #12 on: November 06, 2010, 08:19:20 PM »

Guck mal hier ich habs in ein kleines Core Mod gepackt.
http://www.websitebaker2.org/forum/index.php/topic,19817.0.html
Logged

It is easier to change the specification to fit the program than vice versa.
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!