.htaccess stuff |
[eluser]Fenix[/eluser]
Here is my .htaccess file. The line with the arrow disallows accessing php files via http. Is there a command I could add that would allow it for a specified controller? So if the url was http://mysite.com/api/categories.php, could I disable this for anything after /api/ ? Code: Options -Indexes
[eluser]TheFuzzy0ne[/eluser]
I don't understand. What is the file you want to access via the URI?
[eluser]Fenix[/eluser]
This is for a REST API where the response content-type is requested by adding .xml or .php to the endpoint like this: http://mysite.com/api/categories.xml http://mysite.com/api/categories.php The first example works fine but for the .php, my htaccess file (posted above) is looking for the real file named categories.php. So, I still want the index.php to be removed from the url (http://mysite.com/index.php/api/categories) but I also need it to quit catching the .php extension for /api/categories.php and other api calls like /api/images.php. If that isn't clear... my API controller has methods like categories() and images() and users(). I also have a __construct() and a _remap() function to pull in the query string throw errors if they have missed required parameters etc... This is my _remap() for testing. The .xml extension works fine but the .php extension doesn't work. Code: function _remap($method)
[eluser]slowgary[/eluser]
You could just remove that line from your main htaccess. If you have other php files that you don't want accessible via http, you could keep them in a folder with another htaccess and use "deny from all". |
Welcome Guest, Not a member yet? Register Sign In |