phpandroidjsonurl-rewritingurl-masking

Hide url in php


I have one url which is for sending and retrieving json data. Now I want to hide that url in such a way that it shows the something different but able to send and receive json data like http://freeprojects4u.com/setubandhmultiaction/setubandh.setubandh, this url is also sends and receives json data from this app: https://play.google.com/store/apps/details?id=com.setubandh&hl=en (Setubandh). but I think this site is in asp but I want to do same thing in php. Please help me doing this or suggest any guide or way or any link from where I can do this. Thanks. I had tried so many methods but it is not so satisfactory. Please suggest me any best way. (I had tried url masking using .htaccess)


Solution

  • Looking at what you have mentioned/elaborated in the further comments:

    1. Requirement#1 - Now url is like example.com/sendandreceive.php but I want this to be example.com/sendandreceive/sendand.sendand.

    -> I think what you can do here is you can rewrite rule for the same in the .htaccess.

    1. Requirement#2 - Also when example.com/sendandreceive/sendand.sendand is opened in browser it must need to be return null, means I don't want my data exposed to public.

    -> This also you can do in your .htaccess file where you can check the request's user agent and restrict it to only the mobile user agent access. You can create one page for the message saying request from a particular source/browser is not allowed (This page you can redirect to from your htaccess where you check your user agent. Refer this it may help - https://wordpress.org/support/topic/how-to-redirect-links-for-mobile-using-htaccess