Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 03-26-2012, 06:42 PM   #1
PornHustler
Confirmed User
 
Join Date: May 2009
Posts: 456
Mobile Redirect PHP Help

Ok, I am taking advice from Nicky(I think) and redirecting my mobile traffic to m.mydomain.com before I send it off to wherever I want to.

The problem I am having for some reason is getting the m.mydomain.com to redirect. I want to use a php redirect from one location for all of my sites. So I am using:

<?php
@ini_set('expose_php', 'Off');
@include "http:location of the php file";?>

in the index.php of the m.mydomain.com. I want to be able to change the url at the "location of the php file" one time and it changes it on every site I have. For some reason when I try it its not working.

I am using this in the "location of the php file":

<?php
/* Redirect browser */
header("Location: final redirected URL");
/* Make sure that code below does not get executed when we redirect. */
exit;
?>

Where am I going wrong?

Thanks
__________________
Contact ICQ: 570768377
Sub 1:440 Blog Converting Sponsor
PornHustler is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-26-2012, 06:44 PM   #2
edgeprod
Permanently Gone
 
Industry Role:
Join Date: Mar 2004
Posts: 10,019
You mean include('file'); not include 'file' right?
edgeprod is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-26-2012, 06:45 PM   #3
edgeprod
Permanently Gone
 
Industry Role:
Join Date: Mar 2004
Posts: 10,019
Oh, and you are including the FILE PATH, not some http:// path, right?
edgeprod is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-26-2012, 06:48 PM   #4
u-Bob
there's no $$$ in porn
 
u-Bob's Avatar
 
Industry Role:
Join Date: Jul 2005
Location: icq: 195./568.-230 (btw: not getting offline msgs)
Posts: 33,063
So you want whatever hits m.oneofyourdomains.com to redirect to the same url?

Forget the include mess and use 1 index.php and point all your m.allyourdomains.com to the directory index.php is in.
u-Bob is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-26-2012, 09:25 PM   #5
PornHustler
Confirmed User
 
Join Date: May 2009
Posts: 456
Quote:
Originally Posted by u-Bob View Post
So you want whatever hits m.oneofyourdomains.com to redirect to the same url?

Forget the include mess and use 1 index.php and point all your m.allyourdomains.com to the directory index.php is in.
Whenever anyone goes to the "m" mobile sub domain of any site I have I want to be able to reroute them to another url. But I want to be able to control all of the redirecting from one spot. Change one link and they all change.
__________________
Contact ICQ: 570768377
Sub 1:440 Blog Converting Sponsor
PornHustler is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-26-2012, 09:36 PM   #6
PornHustler
Confirmed User
 
Join Date: May 2009
Posts: 456
Quote:
Originally Posted by edgeprod View Post
You mean include('file'); not include 'file' right?
It was the path to the php file in a folder on one of my domains.

Quote:
Originally Posted by edgeprod View Post
Oh, and you are including the FILE PATH, not some http:// path, right?
I wasn't but I can do that.
__________________
Contact ICQ: 570768377
Sub 1:440 Blog Converting Sponsor
PornHustler is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-26-2012, 09:49 PM   #7
Jakez
Confirmed User
 
Jakez's Avatar
 
Industry Role:
Join Date: Jan 2004
Location: oddfuturewolfgangkillthemall!!!!!!!
Posts: 5,656
Quote:
Originally Posted by PornHustler View Post
Ok, I am taking advice from Nicky(I think) and redirecting my mobile traffic to m.mydomain.com before I send it off to wherever I want to.
Care to elaborate or quote what he said?
__________________
[email protected] - jakezdumb - 573689400

Killuminati
Jakez is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-26-2012, 09:54 PM   #8
PornHustler
Confirmed User
 
Join Date: May 2009
Posts: 456
Quote:
Originally Posted by Jakez View Post
Care to elaborate or quote what he said?
I think it was him, he said something like take his word for it to route the mobile traffic from your site to a subdomain and then to the the destination.

He didn't go into any details.

I took it to mean that google may penalize the site if your just rerouting traffic off your site as soon as they get there but if you route them through a sub domain your main site doesnt get penalized.

But he didn't say that, I inferred it from what he recommended.
__________________
Contact ICQ: 570768377
Sub 1:440 Blog Converting Sponsor
PornHustler is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-26-2012, 10:18 PM   #9
PornHustler
Confirmed User
 
Join Date: May 2009
Posts: 456
I just did a soft 302 redirect from the server to the spot I have the url I want to direct the surfer to.

Works fine.

If there is a better way to do it I am all ears. Otherwise I will just do it this way.
__________________
Contact ICQ: 570768377
Sub 1:440 Blog Converting Sponsor
PornHustler is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-26-2012, 10:22 PM   #10
edgeprod
Permanently Gone
 
Industry Role:
Join Date: Mar 2004
Posts: 10,019
Sorry, I went to bed when I didn't see a reply from you. Do the path to the file on your server, i.e.:

require_once('includes/file.php');

(replace your include line with that)
edgeprod is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-26-2012, 10:27 PM   #11
PornHustler
Confirmed User
 
Join Date: May 2009
Posts: 456
Quote:
Originally Posted by edgeprod View Post
Sorry, I went to bed when I didn't see a reply from you. Do the path to the file on your server, i.e.:

require_once('includes/file.php');

(replace your include line with that)
I tried that. It didnt work. I tried a couple different ways. Nothing worked except the 302.

On a side note I have to say I feel a little stupid about this but I want to place:

RewriteCond %{HTTP_USER_AGENT} (mobile|android|blackberry|brew|cldc|docomo|htc|j2 me|micromax|lg|midp|mot|motorola|netfront|nokia|ob igo|openweb|opera.mini|palm|psp|samsung|sanyo|sch| sonyericsson|symbian|symbos|teleca|up.browser|voda fone|wap|webos|windows.ce) [NC]
RewriteRule ^(.*)$ http://m.myurl.com [R=302,L]

RewriteCond %{HTTP_USER_AGENT} (GoogleTV) [NC]
RewriteRule ^(.*)$ http:myurl.com [R=302,L]

in the htaccess but when I do my site goes 500.

Where exactly should I place this in my wordpress htaccess file?
__________________
Contact ICQ: 570768377
Sub 1:440 Blog Converting Sponsor
PornHustler is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-26-2012, 10:29 PM   #12
edgeprod
Permanently Gone
 
Industry Role:
Join Date: Mar 2004
Posts: 10,019
Quote:
Originally Posted by PornHustler View Post
I tried that. It didnt work. I tried a couple different ways. Nothing worked except the 302.
What didn't work about it? It didn't include the file? That's only as far as I read that cringe-inducing code. I couldn't bring myself to go deeper, LOL.
edgeprod is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-26-2012, 10:32 PM   #13
PornHustler
Confirmed User
 
Join Date: May 2009
Posts: 456
Quote:
Originally Posted by edgeprod View Post
What didn't work about it? It didn't include the file? That's only as far as I read that cringe-inducing code. I couldn't bring myself to go deeper, LOL.
When I included the php file where the end url is in the "m.mysite.com" the broswer doesnt follow the new url. In other words the site never redirects. If I go right to the file in my browser I am redirected and everything is fine.
__________________
Contact ICQ: 570768377
Sub 1:440 Blog Converting Sponsor
PornHustler is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-26-2012, 10:49 PM   #14
edgeprod
Permanently Gone
 
Industry Role:
Join Date: Mar 2004
Posts: 10,019
Quote:
Originally Posted by PornHustler View Post
When I included the php file where the end url is in the "m.mysite.com" the broswer doesnt follow the new url. In other words the site never redirects. If I go right to the file in my browser I am redirected and everything is fine.
There are ways to check why that's happening (whitespace, accidental headers, etc), but if you're content with the 302, that seems to be enough.
edgeprod is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-28-2012, 11:38 AM   #15
Jakez
Confirmed User
 
Jakez's Avatar
 
Industry Role:
Join Date: Jan 2004
Location: oddfuturewolfgangkillthemall!!!!!!!
Posts: 5,656
Quote:
Originally Posted by PornHustler View Post
I think it was him, he said something like take his word for it to route the mobile traffic from your site to a subdomain and then to the the destination.

He didn't go into any details.

I took it to mean that google may penalize the site if your just rerouting traffic off your site as soon as they get there but if you route them through a sub domain your main site doesnt get penalized.

But he didn't say that, I inferred it from what he recommended.
Hm, I dunno, I've been doing a 302 htaccess redirect for a few years now and it's never hurt the PC or mobile SE that I get..
__________________
[email protected] - jakezdumb - 573689400

Killuminati
Jakez is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-28-2012, 11:53 AM   #16
Brujah
Beer Money Baron
 
Brujah's Avatar
 
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
You can use this as the index.php for your m.domain.com, and there's really nothing wrong with using the include this way.

Instead of redirecting from the included file, just use it to populate the url you want to redirect to.

INDEX.PHP for your mobile domains
Code:
<?php
$redirect = file_get_contents( 'http://somedomain.com/mobile.ini' );
header( 'Location: ' . trim( $redirect ) );
exit();
?>
Wherever somedomain.com is, just create the file mobile.ini there. You can call it whatever you want, but all it will contain is a url. No php code or other necessary.

MOBILE.INI or whatever you decide to call it.
Code:
http://redirectmymobiletraffichere.com
__________________
Brujah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-28-2012, 12:04 PM   #17
Brujah
Beer Money Baron
 
Brujah's Avatar
 
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
If you use dropbox, one interesting way of managing this could be to create/edit a file like mobile.ini (or other name) in your Dropbox Public folder. It'd look something like:
http://dl.dropbox.com/u/3782156/mobile.ini

It'd be a file on your computer, but also mirrored to Amazon's Cloud. You still just make that 1 change to a file anytime you want, and all your mobile sites will read it and redirect to the new location.

Could be an interesting strategy for managing your simple data like this for other uses. Maybe even add a simple cache layer, to cache the file in your TMPDIR with an expire time like 15 mins.
__________________
Brujah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-28-2012, 12:24 PM   #18
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,350
http://detectmobilebrowsers.mobi/
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 03-28-2012, 12:48 PM   #19
Klen
 
Klen's Avatar
 
Industry Role:
Join Date: Aug 2006
Location: Little Vienna
Posts: 32,235
Quote:
Originally Posted by fris View Post
That's shitty mobile redirect script which cost 100$ monthly,i wouldn't recommend it.
Klen is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.