Publishing weblogs on separate domains from one installatio

Get help with installation and running PivotX 2.0.x here. Please do not post Extension or Theme related questions here.

Publishing weblogs on separate domains from one installatio

Postby Winjer » Sat Feb 06, 2010 3:52 pm

Hi there,

another beginner's question from me: Is it possible to publish weblogs on two separate domains, when my pivotx installation is located in a subfolder of one of those domains?

E. g. the folder structure of my webspace looks like this:

site1.de (my pivotx installation is located here, in site1.de/pivotx)
site2.de
site3.de
...

Can I publish a weblog on site2.de using the installation from site1.de? I've tried but haven't been successful.

Thank you.
Winjer
 
Posts: 15
Joined: Sat Feb 06, 2010 1:59 pm

Re: Publishing weblogs on separate domains from one installatio

Postby Bob » Sun Feb 07, 2010 12:21 pm

If the domains are on the same server, then this should be possible, with the 'multiple site' feature we have. You'll have seperate databases for each site.

If you want to run them on the same database, with the same content, set up the domains so that they're aliasses. The only tricky bit it then determining what frontpage to show to visitors. You can either do this in htaccess, by redirecting the visitors to a certain page.
Or, in your templates. Set 'set_request_variables' to 1, and do [[print_r var=$request]] in your template. You'll be able to get the domain name from there, and display the appropriate content based on that.
Bob
Lead Developer
 
Posts: 901
Joined: Tue Nov 20, 2007 11:16 pm

Re: Publishing weblogs on separate domains from one installatio

Postby Winjer » Mon Feb 08, 2010 6:05 pm

Thanks, Bob.

Since reading your answer I've experimented a bit, and of course the whole multiple sites setup went over my head. So I guess I just have to explain what I've done and where I stand at the moment:

I've tried to follow the instructions in this thread, but I don't think I understood them correctly.

So from the start:

  • My pivotx installation is located at der-privatanleger.de/pivotx. From this installation I want to run two weblogs on two different domains: der-privatanleger.de and blogblogblog.de.
  • I've created two folders with their respective subfolders: der-privatanleger.de/pivotx/sites/der-privatanleger.de and der-privatanleger.de/pivotx/sites/blogblogblog.de.
  • From the moment on I created the first of the above mentioned folders my - already existent - weblog was run from the new directory, so apparently pivotx is in multiple site mode now.
  • But: I still only have one database and can't publish anything on the 2nd domain. Instead my new Weblog (Blog Blog Blog) appears here: http://der-privatanleger.de/bloblogblog.de. That I don't want.

Now I suspect it has something to do with the directory the domain blogblogblog.de is pointing to. I thought it should be der-privatanleger.de/pivotx/sites/blogblogblog.de. But I haven't been able to set this up, because I keep getting error messages from my provider. But now I suspect that I was wrong in the first place, and the domain should simply point to a different folder. Right?

Thanks for your patience.
Winjer
 
Posts: 15
Joined: Sat Feb 06, 2010 1:59 pm

Re: Publishing weblogs on separate domains from one installatio

Postby hansfn » Mon Feb 08, 2010 11:00 pm

The thread you pointed says:
They are run from the directory /var/www/pivotx-domains, which all the virtual hosts point to

So yes, you are pointing to the wrong directory. Try /.../der-privatanleger.de instead of /.../der-privatanleger.de/pivotx/sites/blogblogblog.de (Yes, all sites/virtual hosts should point to the same directory.)
hansfn
Developer
 
Posts: 1873
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Publishing weblogs on separate domains from one installatio

Postby Winjer » Tue Feb 09, 2010 7:43 am

Thank you. Now both virtual hosts point to /der-privatanleger.de/, and the "view Blog Blog Blog" tab on the dashboard links to the domain blogblogblog.de.

Unfortunately things still don't work. I still only have one database, and I still only have one weblog. There is no site at blogblogblog.de. It seems I'm still doing something wrong. Do I have to change anything in the pivotx backend? Is it a problem that I'm still using a flat file database?
Winjer
 
Posts: 15
Joined: Sat Feb 06, 2010 1:59 pm

Re: Publishing weblogs on separate domains from one installatio

Postby hansfn » Tue Feb 09, 2010 8:26 am

1) You have created all the folders (db, templates, images) as explained in the forum post you pointed to?
2) If you visit blogblogblog.de/pivotx and write an entry, and then visit der-privatanleger.de/pivotx - is the new entry there too?
hansfn
Developer
 
Posts: 1873
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Publishing weblogs on separate domains from one installatio

Postby Winjer » Tue Feb 09, 2010 8:35 am

Sorry, it seems I was a bit hasty - maybe it took some time until the changes on my webspace worked - I only got an error 404, when I tried to access blogblogblog.de/pivotx and thought maybe I had to work from der-privatanleger.de/pivotx. ;)

Thanks again.
Winjer
 
Posts: 15
Joined: Sat Feb 06, 2010 1:59 pm

Re: Publishing weblogs on separate domains from one installatio

Postby Winjer » Sat Mar 06, 2010 5:13 pm

Sorry to bump this old thread, but I've been using multiple site mode for some weeks now and have encountered some minor problems. And unfortunately once more I'm unable to solve them on my own.

The more important problem is a redirection issue:

For my first weblog redirecting from http://www.example.org and http://www.example.org/index.php to example.org works.

For my second weblog however it doesn't: http://www.example1.org doesn't redirect at all, and http://www.example1.org/index.php actually redirects to example.org (i. e. my first weblog).

Now this can probably be solved by getting my .htaccess file right. I've tried some things but most of the time this simply led to error messages on all of the sites, so I stopped soon.

Are there some standard lines I can insert, so that the redirection works on all of the url's?

This is my .htaccess file, maybe it'll help:

Code: Select all
RewriteEngine On

RewriteCond %{HTTP_HOST} ^www.der-privatanleger.de
RewriteRule (.*) http://der-privatanleger.de/$1 [R=301,L]

RewriteRule ^archives/archive_(.*)\.php /index.php?a=$1 [R=301,L]
RewriteCond %{QUERY_STRING} id=([1-9][0-9]*)
RewriteRule ^pivot/entry.php /index.php?e=%1 [R=301,L]
RewriteCond %{QUERY_STRING} c=([^&]*)
RewriteRule ^pivot/archive.php /?c=%1 [R=301,L]
RewriteCond %{QUERY_STRING} tag=([^&]*)
RewriteRule ^pivot/tags.php /index.php?t=%1 [R=301,L]
RewriteRule ^rss\.xml$ /rss [R=301,L]
RewriteRule ^atom\.xml$ /atom [R=301,L]

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ http://der-privatanleger.de/ [R=301,L]

# Standard PivotX rules for non-crufty URLs. Must be enabled in the PivotX
# configuration too before taking affect. Look at the bottom of this file
# for a localized version.
RewriteRule ^archive/(.*)$ pivotx/render.php?uri=$1&rewrite=archive [L,QSA]
RewriteRule ^([0-9]{4})[/-](.*)$ pivotx/render.php?uri=$1/$2&rewrite=archive [L,QSA]
RewriteRule ^entry/(.*)$ pivotx/render.php?e=$1&rewrite=entry [L,QSA]
RewriteRule ^page/(.*)$ pivotx/render.php?uri=$1&rewrite=page [L,QSA]
RewriteRule ^tag/(.*)$ pivotx/render.php?t=$1&rewrite=tag [L,QSA]
RewriteRule ^tags/?$ pivotx/render.php?x=tagpage [L,QSA]
RewriteRule ^search/(.*)$ pivotx/render.php?q=$1&rewrite=search [L,QSA]
RewriteRule ^search$ pivotx/render.php?rewrite=search [L,QSA]
RewriteRule ^visitor/?([^/]*)/?$ pivotx/render.php?x=visitorpage&w=$1 [L,QSA]
RewriteRule ^category/(.*)$ pivotx/render.php?c=$1&rewrite=category [L,QSA]
RewriteRule ^author/(.*)$ pivotx/render.php?u=$1&rewrite=author [L,QSA]
RewriteRule ^browse/(.*)$ pivotx/render.php?o=$1&rewrite=offset [L,QSA]
RewriteRule ^rss/?$ pivotx/render.php?feed=rss [L,QSA]
RewriteRule ^atom/?$ pivotx/render.php?feed=atom [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ pivotx/render.php?uri=$1&rewrite=page [L,QSA]

RewriteRule ^entry/83/wie-man-den-buchwert-je-aktie-berechnet-und-andere-uebungen ^entry/57/wie-man-den-buchwert-je-aktie-berechnet-und-andere-uebungen


Oh, and the 2nd problem is actually a simple question: Does the sitemap extension work with the multiple site mode?
Winjer
 
Posts: 15
Joined: Sat Feb 06, 2010 1:59 pm

Re: Publishing weblogs on separate domains from one installatio

Postby hansfn » Sat Mar 06, 2010 5:37 pm

This isn't a PivotX question - it's only about mod_rewrite. You have added your own stuff to .htaccess, but I'll help you anyway.

The only thing to remember is that when you use PivotX in multi-site mode, all sites/domains use the same .htaccess file.

To get the www to non-www redirect you must have one rule for each domain. In other words, you must add

Code: Select all
RewriteCond %{HTTP_HOST} ^www.example1.org
RewriteRule (.*) http://example1.org/$1 [R=301,L]


To stop http://www.example1.org/index.php from redirects to example.org, you must fix the rule below (by adding a HTTP_HOST condition for example) or remote it.

Code: Select all
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ http://der-privatanleger.de/ [R=301,L]


Finally, I see no reason that the XML sitemap extension shouldn't work in PivotX multi-site mode - the sites are completely separate.
hansfn
Developer
 
Posts: 1873
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway


Return to 2.x Support Forum

Who is online

Users browsing this forum: Baidu [Spider] and 0 guests

cron