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.
Pages: 1
Mobile redirect works great on mobile device but not with i put m.mysite.com in my desktop browser it brings me to desktop. On other sites i know doing m.mysite.com on destop brings them to there mobile site. How can i fix this?
/mobile have an .htaccess
Options -Indexes
Options +FollowSymLinks
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteCond %{QUERY_STRING} SELECT(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} UNION(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} UPDATE(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteRule ^(.*)$ index.php [L,QSA]
RewriteCond %{REQUEST_FILENAME} !\.(flv|mp4|gif|jpg|jpeg|png|css|js|html)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule>
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault A1209600
ExpiresByType text/html A1
ExpiresByType text/html A1
ExpiresByType text/html A1
ExpiresByType text/html A1
</IfModule>
<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file \.(html?|css|js)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>
config.php
<?php
defined('_VALID') or die('Restricted Access!');
return array(
'db_driver' => 'xxxxxx',
'db_host' => 'xxxxxx',
'db_name' => 'xxxxxx',
'db_username' => 'xxxxxx',
'db_password' => 'xxxxxx',
'db_prefix' => '',
'license_key' => 'xxxxxx',
'license_domain' => mysite.com',
'secret' => 'xxxxxx',
'default' => 'xxxxxx',
'base_url' => 'http://www.mysite.com',
'mobile_url' => 'http://www.mysite.com',
'relative' => ''
);
?>
Offline
Edit index.php and change:
require BASE_DIR.'/mobile/mobile.php';
VMobile::process();
to:
VF::redirect('http://m.yourdomain.com');
Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds
Offline
No that didn't work, so here is my:
m.mysite.com.conf
server {
listen 80;
server_name m.mysite.com;
#limit_zone one $binary_remote_addr 10m;
access_log off;
error_log /var/log/nginx/m.mysite.com-error.log notice;
root /xxx/xxx/xxx/public_html;
index index.php;
# Limit the rate after a certain amount of data is send. (Useful for buffering!)
#limit_rate_after 1m;
# Limit rate
#limit_rate 215k;
# limit_rate_after 1000k;
# limit_rate 512k;
location / {
# if file exists return it right away
if (-f $request_filename) {
break;
}
# otherwise rewrite the fucker
if (!-e $request_filename) {
rewrite ^(.+)$ /index.php?q=$1 last;
break;
}
}
# location ~ \.flv {
# secure_link $arg_st,$arg_e;
# secure_link_md5 eM0nD77Q$uri$arg_e$remote_addr;
#
# if ($secure_link = "") {
# return 403;
# }
#
# if ($secure_link = "0") {
# return 403;
# }
#
# flv;
#
# limit_rate_after 256k;
# limit_rate 256k;
# }
#
# location ~ \.mp4 {
# secure_link $arg_st,$arg_e;
# secure_link_md5 eM0nD77Q$uri$arg_e$remote_addr;
#
# if ($secure_link = "") {
# return 403;
# }
mysite.com.conf
#server {
# listen 80;
# server_name mysite.comm;
# rewrite ^(.*) http://www.mysite.comm$1 permanent;
#}
server {
listen 80;
server_name www.mysite.com mysite.com;
#limit_zone one $binary_remote_addr 10m;
access_log off;
error_log /var/log/nginx/mysite.com-error.log notice;
root /xxx/xxx/xxx/public_html/;
index index.php;
set $mobile_rewrite do_not_perform;
## chi http_user_agent for mobile / smart phones ##
if ($http_user_agent ~* "(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocke$
set $mobile_rewrite perform;
}
if ($http_user_agent ~* "^(1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|b$
set $mobile_rewrite perform;
}
## redirect to m.example.com ##
if ($mobile_rewrite = perform) {
rewrite ^ http://m.mysite.com$request_uri? redirect;
break;
}
#set $force_dt_cookie "";
#if ($args ~ 'desktop=true') {
# set $mobile_rewrite do_not_perform;
# set $force_dt_cookie "desktop=true";
#}
#add_header Set-Cookie $force_dt_cookie;
#if ($http_cookie ~ 'desktop=true') {
# set $mobile_rewrite do_not_perform;
#}
# Limit the rate after a certain amount of data is send. (Useful for buffering!)
#limit_rate_after 1m;
# Limit rate
#limit_rate 215k;
# limit_rate_after 1000k;
# limit_rate 512k;
location / {
# if file exists return it right away
if (-f $request_filename) {
Offline
In nginx for m.domain.com you need a config similar to the domain.com config, but without
the flv module and the secure link part for the mp4 videos (of course you need to change the docroot to /where/aspro/is/installed/mobile).
Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds
Offline
I messed with the doc root many times before, even change to public_html/mobile; or public_html/mobile/; both cases the template doesn't load.
Offline
In config.php you have the mobile_url set to http://m.domain.com?
Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds
Offline
Please post the complete nginx config file for the m.domain.com part and i will fix it for you.
Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds
Offline
No. I had posted the config file earlier, also when i updated 1.0.10 it didn't say to change it.
<?php
defined('_VALID') or die('Restricted Access!');
return array(
'db_driver' => 'xxxxxx',
'db_host' => 'xxxxxx',
'db_name' => 'xxxxxx',
'db_username' => 'xxxxxx',
'db_password' => 'xxxxxx',
'db_prefix' => '',
'license_key' => 'xxxxxx',
'license_domain' => mysite.com',
'secret' => 'xxxxxx',
'default' => 'xxxxxx',
'base_url' => 'http://www.mysite.com',
'mobile_url' => 'http://www.mysite.com',
'relative' => ''
);
?>
m.mysite.com.conf
#server {
# listen 80;
# server_name mysite.comm;
# rewrite ^(.*) http://www.mysite.comm$1 permanent;
#}
server {
listen 80;
server_name www.mysite.com mysite.com;
#limit_zone one $binary_remote_addr 10m;
access_log off;
error_log /var/log/nginx/mysite.com-error.log notice;
root /xxx/xxx/xxx/public_html/;
index index.php;
set $mobile_rewrite do_not_perform;
## chi http_user_agent for mobile / smart phones ##
if ($http_user_agent ~* "(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino") {
set $mobile_rewrite perform;
}
if ($http_user_agent ~* "^(1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-)") {
set $mobile_rewrite perform;
}
## redirect to m.example.com ##
if ($mobile_rewrite = perform) {
rewrite ^ http://m.mysite.com$request_uri? redirect;
break;
}
#set $force_dt_cookie "";
#if ($args ~ 'desktop=true') {
# set $mobile_rewrite do_not_perform;
# set $force_dt_cookie "desktop=true";
#}
#add_header Set-Cookie $force_dt_cookie;
#if ($http_cookie ~ 'desktop=true') {
# set $mobile_rewrite do_not_perform;
#}
# Limit the rate after a certain amount of data is send. (Useful for buffering!)
#limit_rate_after 1m;
# Limit rate
#limit_rate 215k;
# limit_rate_after 1000k;
# limit_rate 512k;
location / {
# if file exists return it right away
if (-f $request_filename) {
break;
}
# otherwise rewrite the fucker
if (!-e $request_filename) {
rewrite ^(.+)$ /index.php?q=$1 last;
break;
}
}
location ~ \.flv {
secure_link $arg_st,$arg_e;
secure_link_md5 4GRtYEiI$uri$arg_e$remote_addr;
if ($secure_link = "") {
return 403;
}
if ($secure_link = "0") {
return 403;
}
flv;
limit_rate_after 256k;
limit_rate 256k;
}
location ~ \.mp4 {
secure_link $arg_st,$arg_e;
secure_link_md5 4GRtYEiI$uri$arg_e$remote_addr;
if ($secure_link = "") {
return 403;
}
if ($secure_link = "0") {
return 403;
}
mp4;
limit_rate_after 5m;
limit_rate 64k;
# mp4_buffer_size 100k;
# mp4_max_buffer_size 100k;
}
location ~ \.php$ {
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9001;
fastcgi_param SCRIPT_FILENAME /home/wsaxxx/public_html/$fastcgi_script_name;
fastcgi_index index.php;
}
}
Offline
The update didnt specify to change the config file, because its not the default yet. Only next version of Adult Script Pro will have http://m.domain.com as the default.
Edit config.php and replace:
'mobile_url' => 'http://www.mysite.com',
with:
'mobile_url' => 'http://m.mysite.com',
Here is a valid m.domain.com nginx config file. Yours contains tons of config options that are not required:
server {
listen *:80;
server_name m.domain.com;
access_log /var/log/nginx/m.domain.com-access.log;
error_log /var/log/nginx/m.domain.com-error.log notice;
index index.php;
root /home/username/public_html/mobile;
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
location ~ \.mp4$ {
mp4;
mp4_buffer_size 512k;
mp4_max_buffer_size 5m;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/username/public_html/mobile$fastcgi_script_name;
fastcgi_read_timeout 7200;
include /etc/nginx/fastcgi_params;
}
}
Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds
Offline
Cloudflare is giving me 502 error saying site is offline.
Offline
Disable cloudflare and try again.
Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds
Offline
im now getting this
nginx: [warn] conflicting server name "m.mysite.com" on 0.0.0.0:80, ignored
Offline
You have it set 2 times....a server block with the same server_name in nginx...
Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds
Offline
Works now?
Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds
Offline
Still going to the desktop version when put m.mysite.com in desktop.
Offline
Please email me ssh and i will fix.
Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds
Offline
Ok i emailed the access. Also check video, i had the template work but video didn't.
Offline
Fixed.
Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds
Offline
seems like m.mysite.com.conf needs to located files in the mobile/ directory (yes it's pointed to public_html/mobile;), it's not showing thumbs or playing the videos. Desktop browse of m.mysite.com works perfect now... how ironic.
From desktop i notice when i click "play" on mobile site it switch from m.mysite.com to mysite.com to play the video. Im think from my phone m.mysite.com don't know when to switch to mysite.com to play videos.
Last edited by DuttyRock (2014-09-17 21:58:47)
Offline
This is working correctly for everyone else, so probably there is something wrong with the config. Will check again today. Its required to switch to mysite.com/media/videos/xxx... to play the video, thats where the video is located.
Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds
Offline
even when it's switched i still get 403 error. Can you send a mysite.conf, i will replace it with mines and see if that help the problem.
Offline
Can you send a copy of a working mysite.com.conf?
Offline
Pages: 1