Page 1 of 1

Best practice when customer already as a index.php page?

PostPosted: Tue May 17, 2011 5:30 am
by jhodgski
Hiya,

Normally, when installing my Tera-WURFL code on a client's website, I'll create an index.php page that contains the Tera-WURFL detection/redirection code, and then I just edit their .htaccess file to make index.php the default page to be served.

However, what is the best practice if client already has an index.php page? Should I rename their index.php page to something else and name my Tera-WURFL detection/redirection page index.php (and leave .htaccess untouched)? Or should I name my Tera-WURFL detection/redirection page (e.g.) handleRequest.php so I don't need to rename their existing index.php (then update .htaccess to make handleRequest.php the default)?

I'm guessing it's better practice to use the latter solution (as there would be less chance of them accidentally overwriting my Tera-WURFL detection/redirection page)?

Cheers,
James

Re: Best practice when customer already as a index.php page?

PostPosted: Tue May 17, 2011 8:48 am
by kamermans
Hi James,

I agree that the latter solution would be better so the client doesn't overwrite your changes. Ideally, for a low-medium traffic site, you could use URL Rewriting to send all requests to a handler script that looks at the REQUEST_URI and sends them to either the mobile or desktop version of that page (avoiding infinite redirects with session or cookie vars), but this can be a little cumbersome to program and maintain.

Re: Best practice when customer already as a index.php page?

PostPosted: Sat Jul 02, 2011 12:16 pm
by blizzardofozz
Could you please be more specific on how to make the redirection in htaccess file?
My problem is this: I want to use wurlf on a static website.

I installed the tera-wurlf and tested it and works. I made the mobileTest.php file but can you guide me how to test the user agents when they access the website let say through google search and is some SERP not the index page and I want the user to land on the corresponding page on the mobile version.

My main problem is with htaccess i guess - i cannot redirect properly to mobileTest.php.

Could you help me, please?