Page 2 of 3

Re: easy subdomains with one install (with multiple domains updated)

Posted: Tue Apr 14, 2009 6:41 pm
by viebig
Well, that´s a lot of job!

Great solution.

Re: easy subdomains with one install (with multiple domains updated)

Posted: Tue Apr 14, 2009 6:52 pm
by JeremyBASS
viebig wrote: Well, that´s a lot of job!

Great solution.
Thanks... not to big to do.. takes me -5 mins to set up... 3 basic steps... 7-8 to be complete from head to toe... 

Just hope it helps out...

Cheers
jeremyBass

Re: easy subdomains with one install (with multiple domains updated)

Posted: Tue Apr 14, 2009 7:14 pm
by viebig
Well, for experienced programmers is piece of cake, common mortals have to wait a little more...

regards

Re: easy subdomains with one install (with multiple domains updated)

Posted: Wed Apr 15, 2009 7:02 am
by vilkis
Hi,

If I want to redirect one domain (www.xxx.lt) to one page of CMSMS and another (www.xxx.eu) to another page of CMSMS should I applay all your patch or can applay just part of it?

Vilkis

Re: easy subdomains with one install (with multiple domains updated)

Posted: Wed Apr 15, 2009 3:41 pm
by JeremyBASS
Hello, it really depends... if that is it then yes... part will work just fine... in fact all you need to do is the .htaccess change and the config change and that is it... but if you want any CMSMS created links .... ie menu selflink etc.... you'll need to do more.. hard coding the links free you from all steps but the very first two of the config and .htaccess. 


Let me know if that clears it up... I probably need to do a new version of the write up... under one, as the subdomain and mulity domains are based on the same ideas but are split in to two posts... I'll see what I can do to make things clear.

Cheers
Jeremy

Re: easy subdomains with one install (with multiple domains updated)

Posted: Sun Apr 19, 2009 2:16 am
by JeremyBASS
Here is an update... this is base on the Google docs.  that will pick up the subdomain traffic correctly for


Code: Select all

{assign var=UA_Google value=''} 
{foreach from=$TLDs key=tdlsI item=tdlsIv}
                {if $CurrentTLD eq $tdlsI} 
                               {assign var=UAGoogle value=$tdlsIv}
                {/if}
  {/foreach}



{literal}<__script__ type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</__script>
<__script__ type="text/javascript">
var pageTracker = _gat._getTracker("{/literal}{$UAGoogle|replace:"XX":"-"}{literal}");
pageTracker._initData();
pageTracker._setDomainName(".{/literal}{$MAINdomain}{literal}.{/literal}{$CurrentTLD}{literal}");
pageTracker._trackPageview();
</__script>{/literal}

so what different... ???

I added this line... pageTracker._setDomainName(".{/literal}{$MAINdomain}{literal}.{/literal}{$CurrentTLD}{literal}");

Now you'll get the most out of your SEO work for user tracking. I'll tied all this in a wiki style write-up in a bit...

Cheers
jeremyBass
note you need to have my suggestion of a {global_content name='_domainRealization'} up todate ...

Re: easy subdomains with one install (with multiple domains updated)

Posted: Wed Apr 22, 2009 12:07 pm
by vilkis
Hi,
JeremyBASS wrote: Let me know if that clears it up... I probably need to do a new version of the write up... under one, as the subdomain and mulity domains are based on the same ideas but are split in to two posts... I'll see what I can do to make things clear.

Cheers
Jeremy
I can not do what I want using your posts :( I get the cycle redirection. I just want to do the following thing:
URL www.example.lt is not redirected
URL www.example.eu is redirected to www.example.lt/en/about-us



Vilkis

Re: easy subdomains with one install (with multiple domains updated)

Posted: Wed Apr 22, 2009 2:21 pm
by JeremyBASS
so you page structure is like this?

-lt
- -lt-page2
- - -lt-page2.1
- -lt-page3
-en
- -en-page2
- - -en-page2.1
- -en-page3


of so what is you .htaccess file and you config.... sorry I could tell you were you went wrong till you show me what you have... cheers
jeremyBass

Re: easy subdomains with one install (with multiple domains updated)

Posted: Wed Apr 22, 2009 2:23 pm
by JeremyBASS
tip... if your looking for a way to server content in a few lag... then you need to get content dump in the mix to..... just thought I'd let you know....

Cheers
jeremy

Re: easy subdomains with one install (with multiple domains updated)

Posted: Wed Apr 22, 2009 5:41 pm
by vilkis
Thanks for your help.
Page structure:

1. page1
2. page2
3. page3
4. EN
4.1 page1
4.2 page2
4.3 page3

My .htaccess:

Code: Select all

Options -Indexes
Options +FollowSymLinks
RewriteEngine On

# Might be needed in a subdirectory
RewriteBase /

# URL Filtering helps stop some hack attempts
#IF the URI contains a "http:"
RewriteCond %{QUERY_STRING} http\: [OR]
#OR if the URI contains a "["
RewriteCond %{QUERY_STRING} \[ [OR]
#OR if the URI contains a "]"
RewriteCond %{QUERY_STRING} \] [OR]
#OR if the URI contains a "<__script__>"
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
#OR script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
#OR any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) 
RewriteRule ^.*$ - [F,L] 
# END Filtering

# CMSMS Rewriting
# Set assume mod_rewrite to true in config.php and clear CMSMS cache
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?lapas=$1 [QSA]
# END CMSMS

config.php:

Code: Select all

<?php
$config['process_whole_template'] = true;
$config['output_compression'] = false;

$config['root_url'] = 'http://' . $_SERVER['SERVER_NAME'];
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on')
{
$config['root_url'] = str_replace('http','https',$config['root_url']);
}
$config['use_smarty_php_tags'] = false;

#Automatically assign alias based on page title?
$config['auto_alias_content'] = true;

#------------
#URL Settings
#------------

#Show mod_rewrite URLs in the menu? You must enable 'use_hierarchy' for this to work for modules
$config['assume_mod_rewrite'] = true;

#Extension to use if you're using mod_rewrite for pretty URLs.
$config['page_extension'] = '';

$config['internal_pretty_urls'] = false;

$config['use_hierarchy'] = true;

$config['query_var'] = 'lapas';

$config['locale'] = '';

$config['default_encoding'] = '';
$config['admin_encoding'] = 'utf-8';

$config['old_stylesheet'] = false;


?>
Vilkis

Re: easy subdomains with one install (with multiple domains updated)

Posted: Wed Apr 22, 2009 9:41 pm
by JeremyBASS
ok... you want to add this to your .htaccess
# example.com to www.example.com&nbsp; force -- to insure URL integrity
RewriteCond %{HTTP_HOST} ^(example\.com)$ [NC]
RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L]

# second domain and page alias for its domain root
RewriteCond %{HTTP_HOST} example\.tdl [NC]
RewriteCond %{REQUEST_URI} ^/$
RewriteRule .* /tdl


# subdomain hanlding for both
RewriteCond %{HTTP_HOST} !^www\.example.tdl
RewriteCond %{REQUEST_URI} ^/$
RewriteCond %{HTTP_HOST} ([^.]+)\.example.tdl
RewriteRule ^(.*)$ %1
I will push the www rule if you use the subdomain... Also ... I don't use the Options +FollowSymLinks thou I'm not sure if it'll make a dif...

try those and
thou it will still (mostly) work the way you have it... I go

1. lt
1.1 page1
1.2 page2
2. EN
2.1 page1
2.2 page2
2.3 page3

then you share the rest not in a domain depent area... it helps guard against cross content and content doubling... You want to think of them like folders... folders and pages at the same time  ;)

Hope that helps

Cheers
jeremyBass

Re: easy subdomains with one install (with multiple domains updated)

Posted: Wed Apr 22, 2009 9:59 pm
by vilkis
JeremyBASS,
thank you for your time, but my English is not so good to understand you. I will try to solve the issuse by myself.
Vilkis

Re: easy subdomains with one install (with multiple domains updated)

Posted: Thu Apr 23, 2009 3:39 am
by JeremyBASS
Mostly... it's your .htaccess file... you'd want to place what I posted in there.. start with the red and add the others as needed...

Cheers
Jeremy

Re: easy subdomains with one install (with multiple domains updated)

Posted: Thu Apr 23, 2009 5:35 am
by Dr.CSS
Sorry to say but I don't think you should have ever started this :)...

Re: easy subdomains with one install (with multiple domains updated)

Posted: Thu Apr 23, 2009 7:29 am
by vilkis
JeremyBASS wrote: Mostly... it's your .htaccess file... you'd want to place what I posted in there.. start with the red and add the others as needed...

Cheers
Jeremy
Gotcha, eventually. The script in red did the trick. Thank you for your patience and help.

Vilkis