PDA

View Full Version : Mobile Version, redirection issue



John
September 27, 2011, 08:28 AM
Hi folks,
During the Mobile Version Installation you may have a redirection problem, to fix the problem you should just add one condition in index.php file:

1. open the common index.php files located in script root directory
2. find the code (started at the line ~27):


$redirect_host = explode('/', RL_URL_HOME);
$redirect_host = 'http://'.$redirect_host[2].'/';

if ( false === strpos($_SERVER['HTTP_HOST'], 'www') && false != strpos(RL_URL_HOME, 'www') )
{
$request_url = ltrim($_SERVER['REQUEST_URI'], '/');
header("Location: ". $redirect_host . $request_url);
}
elseif ( false !== strpos($_SERVER['HTTP_HOST'], 'www') && false === strpos(RL_URL_HOME, 'www') )
{
$request_url = ltrim($_SERVER['REQUEST_URI'], '/');
header("Location: ". $redirect_host . $request_url);
}

and replace it with the following code:


if ( false === strpos($_SERVER['HTTP_HOST'], 'm.') )
{
$redirect_host = explode('/', RL_URL_HOME);
$redirect_host = 'http://'.$redirect_host[2].'/';

if ( false === strpos($_SERVER['HTTP_HOST'], 'www') && false != strpos(RL_URL_HOME, 'www') )
{
$request_url = ltrim($_SERVER['REQUEST_URI'], '/');
header("Location: ". $redirect_host . $request_url);
}
elseif ( false !== strpos($_SERVER['HTTP_HOST'], 'www') && false === strpos(RL_URL_HOME, 'www') )
{
$request_url = ltrim($_SERVER['REQUEST_URI'], '/');
header("Location: ". $redirect_host . $request_url);
}
}

3. Save file

Draw attention to the first line in new code:
if ( false === strpos($_SERVER['HTTP_HOST'], 'm.') )
m. is your sub-domain name with dot after it.
For example: if you use "mobile.domain.com" as mobile sub-domain the line should looks like:
if ( false === strpos($_SERVER['HTTP_HOST'], 'mobile.') )

Waiting for your questions.
John

Chun chiang Ming
September 28, 2012, 05:06 AM
hi john,

is this the version 4.1 ?

Nguyen Dat tai
June 8, 2013, 11:10 AM
Hello John,

Im using Flynax Auto 4.1.0

Santiago B
July 22, 2013, 05:37 PM
Im having problems with redirection,

it goes to a _blank page.

i configured it as subdomain, pointing to root.

Mike
July 23, 2013, 04:10 AM
I'm sure that instruction is not for 4.1 version.

Santiago B., Nguyen - i suppose you have mobile version redirection issues ? It's better to create ticket to get this resolved or provide somebody from staff with detailed problem description and ftp access via PM.

Santiago B
July 24, 2013, 10:06 PM
I could solved Mike Thanks!