Adult Script Pro Community Forums

The forum is here for legacy reasons. No new posts will be created. User registration is disabled! If you have any questions, please email us or check https://www.adultscriptpro.com for more details!

You are not logged in.

#1 2013-12-16 22:52:31

Eri
Member
Registered: 2011-03-18
Posts: 977

make mobile subdomain

How to change mobile link from
http://site.com/mobile/
to
http://m.site.com


Best Adult Affilitate Network:
ExoClick
Best Deals on Dedicated Servers - CDN
INXY

Offline

#2 2013-12-17 16:30:05

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: make mobile subdomain

Its a little complicated (i've dont it before for a few sites). I will post a howto tomorrow.


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#3 2013-12-19 17:44:17

Eri
Member
Registered: 2011-03-18
Posts: 977

Re: make mobile subdomain

hi Adrian any news on this?


Best Adult Affilitate Network:
ExoClick
Best Deals on Dedicated Servers - CDN
INXY

Offline

#4 2013-12-19 21:13:11

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: make mobile subdomain

Erm...none yet. Will write asap. It requires a lot of modifications, need to test before.


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#5 2013-12-22 17:51:48

Eri
Member
Registered: 2011-03-18
Posts: 977

Re: make mobile subdomain

thanks, i think it should be like this at the next version. Better for seo


Best Adult Affilitate Network:
ExoClick
Best Deals on Dedicated Servers - CDN
INXY

Offline

#6 2013-12-23 15:13:32

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: make mobile subdomain

In order to make m.domain.com work you need to make the following changes:
1. Copy .htaccess to the /mobile folder
2. Edit mobile/index.php and replace:

$_GET['q'] = 'mobile';

with:

if (!isset($_SERVER['HTTP_HOST']) OR $_SERVER['HTTP_HOST'] != 'm.domain.com') {
    $_GET['q'] = 'mobile';
}

3. Edit mobile/mobile.php and replace:

            'template_url'  => BASE_URL.'/mobile/templates/'.$template,
            'template_rel'  => RELATIVE_URL.'/mobile/templates/'.$template

with:

            'template_url'  => MOBILE_URL.'/templates/'.$template,
            'template_rel'  => MOBILE_REL.'/templates/'.$template

also replace:

            define('MOBILE_URL', BASE_URL);
            define('MOBILE_REL', RELATIVE_URL);

with:

            define('MOBILE_URL', 'http://m.domain.com');
            define('MOBILE_REL', '');

4. Edit mobile/templates/default/community.tpl.php and replace:

<?php echo MEDIA_REL; ?>/users/<?php 

with:

<?php echo USER_URL,'/';

5. Edit mobile/templates/default/extend/plugins/pagination.plugin.php and replace:

    if (isset($_GET['page'])) {
        return preg_replace('/page=(\w+)/i', 'page='.$page, CURRENT_URL);
    } else {
        return CURRENT_URL.((strpos(CURRENT_URL, '?')) ? '&' : '?').'page='.$page;
    }

with:

    $url    = str_replace(BASE_URL, 'http://m.localhost.com', CURRENT_URL);

    if (isset($_GET['page'])) {
        return preg_replace('/page=(\w+)/i', 'page='.$page, $url);
    } else {
        return $url.((strpos($url, '?')) ? '&' : '?').'page='.$page;
    }

6. Edit libraries/bootstrap.php and replace:

define('THUMB_URL', (defined('CDN_THUMB_URL')) ? CDN_THUMB_URL : MEDIA_REL.'/videos/tmb');
define('PHOTO_URL', (defined('CDN_PHOTO_URL')) ? CDN_PHOTO_URL : MEDIA_REL.'/photos');
define('MODEL_URL', (defined('CDN_MODEL_URL')) ? CDN_MODEL_URL : MEDIA_REL.'/pornstars');
define('USER_URL', (defined('CDN_USER_URL')) ? CDN_USER_URL : MEDIA_REL.'/users');

with:

if (isset($_SERVER['HTTP_HOST']) && $_SERVER['HTTP_HOST'] == 'm.localhost.com') {
    define('THUMB_URL', (defined('CDN_THUMB_URL')) ? CDN_THUMB_URL : MEDIA_URL.'/videos/tmb');
    define('PHOTO_URL', (defined('CDN_PHOTO_URL')) ? CDN_PHOTO_URL : MEDIA_URL.'/photos');
    define('MODEL_URL', (defined('CDN_MODEL_URL')) ? CDN_MODEL_URL : MEDIA_URL.'/pornstars');
    define('USER_URL', (defined('CDN_USER_URL')) ? CDN_USER_URL : MEDIA_URL.'/users');
} else {
    define('THUMB_URL', (defined('CDN_THUMB_URL')) ? CDN_THUMB_URL : MEDIA_REL.'/videos/tmb');
    define('PHOTO_URL', (defined('CDN_PHOTO_URL')) ? CDN_PHOTO_URL : MEDIA_REL.'/photos');
    define('MODEL_URL', (defined('CDN_MODEL_URL')) ? CDN_MODEL_URL : MEDIA_REL.'/pornstars');
    define('USER_URL', (defined('CDN_USER_URL')) ? CDN_USER_URL : MEDIA_REL.'/users');
}

Thats it. Now in index.php you can redirect to http://m.domain.com when a visitor has been identified as mobile.


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#7 2014-01-09 10:48:57

Eri
Member
Registered: 2011-03-18
Posts: 977

Re: make mobile subdomain

is there a way to remove the /mobile/ from the link?

Found this article how mobile link should be,

Great news is that you can maintain the desktop path which they were initially loading, and dynamically send them to the mobile site’s version using the {path} parameter. For example, in the mobile site URL you could enter http://m.example.com/{path} and the desktop site path which the user came from would be maintained in the mobile site URL. In the previous example, if a mobile user viewed http://www.example.com/article.html they would then be redirected to http://m.example.com/article.html.


I think mobile should be separated from the main script and can be installed at m.site.com subdomain. As the premium plugin.

Last edited by Eri (2014-01-09 11:25:59)


Best Adult Affilitate Network:
ExoClick
Best Deals on Dedicated Servers - CDN
INXY

Offline

#8 2014-01-09 14:08:49

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: make mobile subdomain

The best way to have mobile is responsive design, however we dont have that yet (no script out there has it yet). Only next version we will have it. The /mobile/ is not included in the URL, unless it is entered in the browser url bar. It can be disabled if you want (and it will return 404).


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#9 2014-01-09 19:01:37

Eri
Member
Registered: 2011-03-18
Posts: 977

Re: make mobile subdomain

symtab wrote:

Only next version we will have it.

ASP is always one step forward, great smile


Best Adult Affilitate Network:
ExoClick
Best Deals on Dedicated Servers - CDN
INXY

Offline

#10 2014-01-24 21:52:17

DuttyRock
Member
Registered: 2011-11-05
Posts: 740

Re: make mobile subdomain

symtab wrote:

In order to make m.domain.com work you need to make the following changes:
1. Copy .htaccess to the /mobile folder
2. Edit mobile/index.php and replace:

$_GET['q'] = 'mobile';

with:

if (!isset($_SERVER['HTTP_HOST']) OR $_SERVER['HTTP_HOST'] != 'm.domain.com') {
    $_GET['q'] = 'mobile';
}

3. Edit mobile/mobile.php and replace:

            'template_url'  => BASE_URL.'/mobile/templates/'.$template,
            'template_rel'  => RELATIVE_URL.'/mobile/templates/'.$template

with:

            'template_url'  => MOBILE_URL.'/templates/'.$template,
            'template_rel'  => MOBILE_REL.'/templates/'.$template

also replace:

            define('MOBILE_URL', BASE_URL);
            define('MOBILE_REL', RELATIVE_URL);

with:

            define('MOBILE_URL', 'http://m.domain.com');
            define('MOBILE_REL', '');

4. Edit mobile/templates/default/community.tpl.php and replace:

<?php echo MEDIA_REL; ?>/users/<?php 

with:

<?php echo USER_URL,'/';

5. Edit mobile/templates/default/extend/plugins/pagination.plugin.php and replace:

    if (isset($_GET['page'])) {
        return preg_replace('/page=(\w+)/i', 'page='.$page, CURRENT_URL);
    } else {
        return CURRENT_URL.((strpos(CURRENT_URL, '?')) ? '&' : '?').'page='.$page;
    }

with:

    $url    = str_replace(BASE_URL, 'http://m.localhost.com', CURRENT_URL);

    if (isset($_GET['page'])) {
        return preg_replace('/page=(\w+)/i', 'page='.$page, $url);
    } else {
        return $url.((strpos($url, '?')) ? '&' : '?').'page='.$page;
    }

6. Edit libraries/bootstrap.php and replace:

define('THUMB_URL', (defined('CDN_THUMB_URL')) ? CDN_THUMB_URL : MEDIA_REL.'/videos/tmb');
define('PHOTO_URL', (defined('CDN_PHOTO_URL')) ? CDN_PHOTO_URL : MEDIA_REL.'/photos');
define('MODEL_URL', (defined('CDN_MODEL_URL')) ? CDN_MODEL_URL : MEDIA_REL.'/pornstars');
define('USER_URL', (defined('CDN_USER_URL')) ? CDN_USER_URL : MEDIA_REL.'/users');

with:

if (isset($_SERVER['HTTP_HOST']) && $_SERVER['HTTP_HOST'] == 'm.localhost.com') {
    define('THUMB_URL', (defined('CDN_THUMB_URL')) ? CDN_THUMB_URL : MEDIA_URL.'/videos/tmb');
    define('PHOTO_URL', (defined('CDN_PHOTO_URL')) ? CDN_PHOTO_URL : MEDIA_URL.'/photos');
    define('MODEL_URL', (defined('CDN_MODEL_URL')) ? CDN_MODEL_URL : MEDIA_URL.'/pornstars');
    define('USER_URL', (defined('CDN_USER_URL')) ? CDN_USER_URL : MEDIA_URL.'/users');
} else {
    define('THUMB_URL', (defined('CDN_THUMB_URL')) ? CDN_THUMB_URL : MEDIA_REL.'/videos/tmb');
    define('PHOTO_URL', (defined('CDN_PHOTO_URL')) ? CDN_PHOTO_URL : MEDIA_REL.'/photos');
    define('MODEL_URL', (defined('CDN_MODEL_URL')) ? CDN_MODEL_URL : MEDIA_REL.'/pornstars');
    define('USER_URL', (defined('CDN_USER_URL')) ? CDN_USER_URL : MEDIA_REL.'/users');
}

Thats it. Now in index.php you can redirect to http://m.domain.com when a visitor has been identified as mobile.

I followed this but not getting m.domain.com

Offline

#11 2014-01-25 07:44:22

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: make mobile subdomain

Hmmm...it should have worked, it works for me and also for Eri. I can check if you want.


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#12 2014-01-25 16:04:43

DuttyRock
Member
Registered: 2011-11-05
Posts: 740

Re: make mobile subdomain

Yeah, i double check, i must not get the .htaccess part, copy the one from plublic_html to mobile/

my template looks messed up lol

i sent you the access.

Offline

#13 2014-01-26 08:28:31

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: make mobile subdomain

Ok. I will check.


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#14 2014-01-27 20:47:01

DuttyRock
Member
Registered: 2011-11-05
Posts: 740

Re: make mobile subdomain

Any update smile

Offline

#15 2014-01-28 12:52:23

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: make mobile subdomain

None yet. Will check ASAP.


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#16 2014-01-30 06:55:07

DuttyRock
Member
Registered: 2011-11-05
Posts: 740

Re: make mobile subdomain

Any feedback on the issue?

Offline

#17 2014-01-30 07:40:04

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: make mobile subdomain

I checked, but you didnt have the subdomain setup. I will check again today.


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#18 2014-01-30 20:08:57

DuttyRock
Member
Registered: 2011-11-05
Posts: 740

Re: make mobile subdomain

Okay, so step 1 should be create a subdomain smile

I will do that an see what happens.

Offline

#19 2014-01-31 08:03:47

DuttyRock
Member
Registered: 2011-11-05
Posts: 740

Re: make mobile subdomain

My mobile template look messed up after doing step 3.

3. Edit mobile/mobile.php and replace:

            'template_url'  => BASE_URL.'/mobile/templates/'.$template,
            'template_rel'  => RELATIVE_URL.'/mobile/templates/'.$template

with:

            'template_url'  => MOBILE_URL.'/templates/'.$template,
            'template_rel'  => MOBILE_REL.'/templates/'.$template

also replace:

            define('MOBILE_URL', BASE_URL);
            define('MOBILE_REL', RELATIVE_URL);

with:

            define('MOBILE_URL', 'http://m.domain.com');
            define('MOBILE_REL', '');

Offline

#20 2014-01-31 11:06:44

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: make mobile subdomain

You need to finish all steps and then test. BACKUP BACKUP BACKUP!


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#21 2014-01-31 14:21:07

DuttyRock
Member
Registered: 2011-11-05
Posts: 740

Re: make mobile subdomain

I reverse this to the original and now the template looks normal.

3. Edit mobile/mobile.php and replace:

            'template_url'  => BASE_URL.'/mobile/templates/'.$template,
            'template_rel'  => RELATIVE_URL.'/mobile/templates/'.$template

with:

            'template_url'  => MOBILE_URL.'/templates/'.$template,
            'template_rel'  => MOBILE_REL.'/templates/'.$template

Offline

#22 2014-01-31 16:28:29

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: make mobile subdomain

Is the subdomain pointed to /where/asp/is/installed/mobile?


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#23 2014-01-31 16:33:31

DuttyRock
Member
Registered: 2011-11-05
Posts: 740

Re: make mobile subdomain

If i remember correctly, when i point it to /mobile/ it wouldn't show thumbs, so i changed that to /installed/ then thumbs worked properly. Basically i kept the same root as main config.

Offline

#24 2014-03-03 09:01:45

discuss4u
Member
Registered: 2013-03-06
Posts: 163

Re: make mobile subdomain

Personally, I go for the suggestion by symtab before

I install the script to another directory using the same database as www.domain.com and point m.domain.com to this new installation.

This works quite well for me.

Offline

Board footer

Powered by FluxBB