Skip to content
Snippets Groups Projects
.htaccess 690 B
Newer Older
Sibidharan's avatar
Sibidharan committed
Header add Access-Control-Allow-Origin: *
Sibidharan's avatar
Sibidharan committed
Header add Access-Control-Allow-Methods: *
Header add Access-Control-Request-Headers: *
Sibidharan's avatar
Sibidharan committed
RewriteEngine On
Sibidharan's avatar
Sibidharan committed
RewriteBase /
Sibidharan's avatar
Sibidharan committed

Sibidharan's avatar
Sibidharan committed
RewriteRule ^/?api/([^/]+)?$ api/index.php?rquest=$1 [L,QSA,NC]
RewriteRule ^/?api/([^/]+)/([^/]+)?$ api/index.php?rquest=$2&namespace=$1 [L,QSA,NC]
Sibidharan's avatar
Sibidharan committed

Sibidharan's avatar
Sibidharan committed

Sibidharan's avatar
Sibidharan committed
## For general files, if not above, just remove .php
Sibidharan's avatar
Sibidharan committed

Sibidharan's avatar
Sibidharan committed
# Redirect external .php requests to 404 Error (Pretending that I am not doing PHP)
RewriteCond %{THE_REQUEST} ^(.+)\.php([#?][^\ ]*)?\ HTTP/
RewriteRule ^(.+)\.php$ "http://%{HTTP_HOST}/$1" [R=404,L]

# Resolve .php file for extensionless php urls
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^([^/.]+)$ $1.php [L]