From 171011ee581a33c96cf5b0a75fa4c58ea30906cd Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Fri, 16 Nov 2012 13:11:03 -0600 Subject: [PATCH] Fix API .htaccess file Before it required an edit for osTicket installations made to a folder other than the root of a domain or subdomain. Now, the installation path is autodetected and rewritted. Also, don't assume that every Apache installation has mod_rewrite support. --- api/.htaccess | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/api/.htaccess b/api/.htaccess index e73e2eb3b..f460420d6 100644 --- a/api/.htaccess +++ b/api/.htaccess @@ -1,8 +1,11 @@ -RewriteEngine On +<IfModule mod_rewrite.c> -RewriteBase /api/ +RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d +RewriteCond %{REQUEST_URI} (.*/api) + +RewriteRule ^(.*)$ %1/http.php/$1 [L] -RewriteRule ^(.*)$ http.php/$1 [L] +</IfModule> -- GitLab