PHP Classes

File: .htaccess

Recommend this page to a friend!
  Classes of Pierre-Henry Soria   PHP RESTful API Example   .htaccess   Download  
File: .htaccess
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: PHP RESTful API Example
Example implementation of a REST API
Author: By
Last change:
Date: 7 months ago
Size: 617 bytes
 

Contents

Class file image Download
# DirectoryIndex index.php <IfModule mod_rewrite.c> <IfModule mod_negotiation.c> # Disable Directory Browsing Options -MultiViews -Indexes </IfModule> Options +FollowSymLinks # Indicate to Apache to enable URLs rewrite RewriteEngine On # Uncomment below "#RewriteBase /"if installed in a folder, and then, add the folder name after the slash "/" # RewriteBase / # This is where the magic happens # Rewrite the requests to index.php with correct GET params RewriteRule ^([^/]+)/?([^/]+)?/?([^/]+)?/?$ index.php?resource=$1&action=$2&id=$3 [QSA,L] </IfModule>