Skip to content

Instantly share code, notes, and snippets.

@amusarra
Last active August 29, 2015 13:56
Show Gist options
  • Save amusarra/9209038 to your computer and use it in GitHub Desktop.
Save amusarra/9209038 to your computer and use it in GitHub Desktop.
SugarCRM 7.1 - Web Server Configuration
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
# Replace <basepath> with the relative web root path to your instance
RewriteBase /<basepath>
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^rest/(.*)$ api/rest.php?__sugar_url=$1 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^cache/api/metadata/lang_(.._..)_(.*)_public\.json$ api/rest.php/v10/lang/public/$1?platform=$2 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^cache/api/metadata/lang_(.._..)_([^_]*)\.json$ api/rest.php/v10/lang/$1?platform=$2 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^cache/Expressions/functions_cache(_debug)?.js$ api/rest.php/v10/ExpressionEngine/functions?debug=$1 [L,QSA]
</IfModule>
location / {
if (!-d $request_filename){
set $rule_0 true;
}
if (!-f $request_filename){
set $rule_0 true;
}
if ($rule_0){
rewrite ^/rest/(.*)$ /api/rest.php?__sugar_url=$1 last;
rewrite ^/cache/api/metadata/lang_(.._..)_(.*)_public\.json$ /rest/v10/lang/public/$1?platform=$2 last;
rewrite ^/cache/api/metadata/lang_(.._..)_([^_]*)\.json$ /rest/v10/lang/$1?platform=$2 last;
rewrite ^/portal/(.*)$ /portal2/$1 last;
rewrite ^/portal$ /portal/? permanent;
}
try_files $uri $uri/ index.php;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment