1
fredski
Xoops problem on Aliased Domains
  • 2005/8/4 10:15

  • fredski

  • Quite a regular

  • Posts: 265

  • Since: 2004/1/26


I have noticed a problem with my aliased domains, for some reason when I click on any link on the aliased domain it will take me to the page on the main domain.

ie, Say I'm on domain2.co.uk and click a link to news,
instead going to domain2.co.uk/modules/news
it goes to domain1.co.uk/modules/news

Is there a reason that XOOPS is specifying the domain url before the folders? as there isn't any reason it should need to.

Any help would be much appreciated.

Thanks :)

2
Herko
Re: Xoops problem on Aliased Domains
  • 2005/8/4 11:19

  • Herko

  • XOOPS is my life!

  • Posts: 4238

  • Since: 2002/2/4 1


make sure that the path info in mainfile.php is correct.

Herko

3
fredski
Re: Xoops problem on Aliased Domains
  • 2005/8/4 12:55

  • fredski

  • Quite a regular

  • Posts: 265

  • Since: 2004/1/26


Well heres my mainfile.php
can you have a look and see where I'm going wrong?

if ( !defined("XOOPS_MAINFILE_INCLUDED") ) {
    
define("XOOPS_MAINFILE_INCLUDED",1);

    
// XOOPS Physical Path
    // Physical path to your main XOOPS directory WITHOUT trailing slash
    
define('XOOPS_ROOT_PATH''/home/httpd/vhosts/domain1.com/httpdocs');

    
// XOOPS Virtual Path (URL)
    // Virtual path to your main XOOPS directory WITHOUT trailing slash
    
define('XOOPS_URL''http://www.domain1.com');
    
define('XOOPS_CHECK_PATH'1);
    
// Protect against external scripts execution if safe mode is not enabled
    
if ( XOOPS_CHECK_PATH && !@ini_get('safe_mode') ) {
        if ( 
function_exists('debug_backtrace') ) {
            
$xoopsScriptPath debug_backtrace();
            if ( !
count($xoopsScriptPath) ) {
                 die(
"XOOPS path check: this file cannot be requested directly");
            }
            
$xoopsScriptPath $xoopsScriptPath[0]['file'];
        } else {
            
$xoopsScriptPath = isset($_SERVER['PATH_TRANSLATED']) ? $_SERVER['PATH_TRANSLATED'] :  $_SERVER['SCRIPT_FILENAME'];
        }
        if ( 
DIRECTORY_SEPARATOR != '/' ) {
            
// IIS6 may double the  chars
            
$xoopsScriptPath str_replacestrpos$xoopsScriptPath'\\') ? '\\' DIRECTORY_SEPARATOR'/'$xoopsScriptPath);
        }
        if ( 
strcasecmpsubstr($xoopsScriptPath0strlen(XOOPS_ROOT_PATH)), str_replaceDIRECTORY_SEPARATOR'/'XOOPS_ROOT_PATH)) ) {
             exit(
"XOOPS path check: Script is not inside XOOPS_ROOT_PATH and cannot run.");
        }
    }

    
// Database
    // Choose the database to be used
    
define('XOOPS_DB_TYPE''mysql');

    
// Table Prefix
    // This prefix will be added to all new tables created to avoid name conflict in the database. If you are unsure, just use the default 'xoops'.
    
define('XOOPS_DB_PREFIX''xoops');

    
// Database Hostname
    // Hostname of the database server. If you are unsure, 'localhost' works in most cases.
    
define('XOOPS_DB_HOST''localhost');

    
// Database Username
    // Your database user account on the host
    
define('XOOPS_DB_USER''myuser');

    
// Database Password
    // Password for your database user account
    
define('XOOPS_DB_PASS''mypass');

    
// Database Name
    // The name of database on the host. The installer will attempt to create the database if not exist
    
define('XOOPS_DB_NAME''mydata');

    
// Use persistent connection? (Yes=1 No=0)
    // Default is 'Yes'. Choose 'Yes' if you are unsure.
    
define('XOOPS_DB_PCONNECT'0);

    
define('XOOPS_GROUP_ADMIN''1');
    
define('XOOPS_GROUP_USERS''2');
    
define('XOOPS_GROUP_ANONYMOUS''3');

    if (!isset(
$xoopsOption['nocommon'])) {
        include 
XOOPS_ROOT_PATH."/include/common.php";
    }
}
?>


Any help would be appreciated.

4
bluenova
Re: Xoops problem on Aliased Domains

10th line down

define('XOOPS_URL', 'http://www.domain1.com');

Change to the correct domain name

5
fredski
Re: Xoops problem on Aliased Domains
  • 2005/8/4 13:18

  • fredski

  • Quite a regular

  • Posts: 265

  • Since: 2004/1/26


Quote:

bluenova wrote:
10th line down

define('XOOPS_URL', 'http://www.domain1.com');

Change to the correct domain name


At the moment its named as my main site url

'http://www.ideal-handling.com'

This is whats causing a problem on my aliased domain. i.e ideal-handling.co.uk, because all the internal links use full urls like http://www.ideal-handling.com/modules/news and not /modules/news, because there is not need to add the domain to an internal link.

Due to this I cannot navigate my aliased site without being directed to the main sites domain pages, which I don't want.

6
fredski
Re: Xoops problem on Aliased Domains
  • 2005/8/4 15:24

  • fredski

  • Quite a regular

  • Posts: 265

  • Since: 2004/1/26


is there anyway I can change the define('XOOPS_URL', 'http://www.domain1.com'); so that it checks what the reffering domain is from a list of specified domains and puts that as the defined url???????


Thoughts on this anyone?

7
Lance_
Re: Xoops problem on Aliased Domains
  • 2005/8/4 15:35

  • Lance_

  • Home away from home

  • Posts: 983

  • Since: 2004/1/12


You can use the multisite hack of mainfile.php.

mainfile.php

if (!(isset($subdominio))) {

$subdominio $HTTP_HOST;

$subdominio str_replace("www.","",$subdominio); 

$subdominio str_replace(".com","",$subdominio); 

$subdominio str_replace(".net","",$subdominio); 

$subdominio str_replace(".org","",$subdominio);





if (!(empty(
$subdominio))) {

include(
$subdominio.".mainfile.php");

}

?>


Then have 2 mainfiles and give them the names domain1.mainfile.php and domain2.mainfile.php, each having the correct url in them.

Cheers.
GDL-Web.com :: Website development.
Xoopslance.com::Freelancing and Projects
thelionsden-arena.net:: Clan/League/Ladder Hosting

8
fredski
Re: Xoops problem on Aliased Domains
  • 2005/8/4 16:10

  • fredski

  • Quite a regular

  • Posts: 265

  • Since: 2004/1/26


Lance Your A STAR

That worked a treat

9
LazyBadger
Re: Xoops problem on Aliased Domains

If two sites work as full mirrors (same context, same web-root, only different URL), Multisite hack is overkill

define('XOOPS_URL', 'http://'.$HTTP_HOST);

work for all my multinamed sites
Quis custodiet ipsos custodes?

Webmaster of
XOOPS2.RU
XOOPS Modules Proving Ground
XOOPS Themes Exhibition

10
fredski
Re: Xoops problem on Aliased Domains
  • 2005/8/4 16:27

  • fredski

  • Quite a regular

  • Posts: 265

  • Since: 2004/1/26


Spoke too soon :(

Lance your code worked a treat till I tried accessing the domain without specifying www. then it all went tits up.

Tried your way badger and everything is sweet :)

Login

Who's Online

232 user(s) are online (189 user(s) are browsing Support Forums)


Members: 0


Guests: 232


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits