How can I test for a URLs existeance before redirecting to it?

Posted by ckliborn on Pro Webmasters See other posts from Pro Webmasters or by ckliborn
Published on 2012-05-30T16:12:39Z Indexed on 2012/05/30 17:00 UTC
Read the original article Hit count: 272

Filed under:
|
|
|

I am using Apache's mod_rewrite to redirect mobile users to my mobile site based on their http_user_agent. However not all pages have a mobile equivalent. Also mobile pages end in .html and "full" pages end in .shtml.

Here is some pseudo code.

Does the user have a certain HTTP_USER_AGENT?

Is there a mobile page?

If so take them there. If not, no redirection is needed.

I want to do this with apache.

© Pro Webmasters or respective owner

Related posts about apache

Related posts about mod-rewrite