Skip to content

Commit

Permalink
More Minor Bug Fixes!
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr. Simon A. Xaies committed Jul 3, 2019
1 parent b44643a commit b2abf4c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
20 changes: 14 additions & 6 deletions .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,34 @@
##
##


RewriteEngine On
RewriteCond %{REQUEST_URI} ^(test.api)$
RewriteRule ^test.api?format=(php|json|serial|xml)$ ./test.php?response=$1&action=test&version=v2 [L,NC,QSA]
RewriteRule ^test.api$ ./test.php?response=json&action=test&version=v2 [L,NC,QSA]

RewriteEngine On
RewriteCond %{REQUEST_URI} ^(favicon|icon|url).(ico|png|api)$
RewriteCond %{HTTP_HOST} ([a-z0-9]){1,64}.(localhost|snails.email)$
RewriteCond %{REQUEST_URI} ^(favicon|icon|url|index).(ico|png|api|html)$
RewriteRule ^favicon.ico$ ./assets/images/favicon.ico [L,NC,QSA]
RewriteRule ^icon.png$ ./assets/images/icon.png [L,NC,QSA]
RewriteRule ^url.api$ ./index.php?action=url [L,NC,QSA]
RewriteRule ^index.html$ ./index.php [L,NC,QSA]

RewriteEngine On
RewriteCond %{HTTP_HOST} ([a-z0-9]){1,64}.(localhost|snails.email)$
RewriteCond %{REQUEST_URI} ^assets/(media|css|jquery|images)/(.*?)$
RewriteRule ^/(media|css|jquery|images)/(.*?)/(.*?)/(.*?)$ ./assets/$1/$2/$3/$4 [L,NC,QSA]
RewriteRule ^/(media|css|jquery|images)/(.*?)/(.*?)$ ./assets/$1/$2/$3 [L,NC,QSA]
RewriteRule ^/(media|css|jquery|images)/(.*?)$ ./assets/$1/$2 [L,NC,QSA]

RewriteEngine On
RewriteCond %{HTTP_HOST} ([a-z0-9]){1,64}.(localhost|snails.email)$
RewriteCond %{REQUEST_URI} ^([a-z0-9]{2})/(.*?)$
RewriteRule ^([a-z0-9]{2})/url.api$ ./index.php?action=url [L,NC,QSA]
RewriteRule ^([a-z0-9]{2})/(.*?)$ ./index.php?action=jump&item=$2&version=$1 [L,NC,QSA]


RewriteEngine On
RewriteCond %{REQUEST_URI} ^data/(php|json|serial|xml)$
RewriteRule ^(data)/(php|json|serial|xml)/(.*?)$ ./index.php?action=$1&response=$2&item=$3 [L,NC,QSA]
Expand All @@ -32,11 +43,8 @@ RewriteRule ^(data)/(php|json|serial|xml)$ ./index.php?action=$1&response=$2&sub

RewriteEngine On
RewriteCond %{HTTP_HOST} (.*?).([a-z0-9]){1,64}.(localhost|snails.email)$
RewriteCond %{REQUEST_URI} ^(index).(html)$
RewriteRule ^$ ./index.php?action=jump&subdomain=1 [L,NC,QSA]

RewriteEngine On
RewriteCond %{REQUEST_URI} ^assets/(media|css|jquery|images)/(.*?)$
RewriteRule ^/(media|css|jquery|images)/(.*?)/(.*?)/(.*?)$ ./assets/$1/$2/$3/$4 [L,NC,QSA]
RewriteRule ^/(media|css|jquery|images)/(.*?)/(.*?)$ ./assets/$1/$2/$3 [L,NC,QSA]
RewriteRule ^/(media|css|jquery|images)/(.*?)$ ./assets/$1/$2 [L,NC,QSA]

RewriteRule ^$ http://%{HTTP_HOST}/index.html [L,R=301]
8 changes: 7 additions & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,13 @@
$parts = explode(".", $_SERVER['HTTP_HOST']);
$item = $parts[0];
} elseif (($action == 'jump' || $action == 'data') && !empty($_REQUEST['item']))
$item = $_REQUEST['item'];
$item = $_REQUEST['item'];
if (strlen(basename(__DIR__))<strlen($_SERVER['HTTP_HOST'])) {
$parts = explode(".", $_SERVER['HTTP_HOST']);
$item = $parts[0];
if ($action == 'default')
$action = 'jump';
}

switch ($action) {
default:
Expand Down

0 comments on commit b2abf4c

Please sign in to comment.