Skip to content

Instantly share code, notes, and snippets.

@MaxLazar
Created December 17, 2019 17:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save MaxLazar/36204c177b8c13448771e5fbe2b1c55a to your computer and use it in GitHub Desktop.
Save MaxLazar/36204c177b8c13448771e5fbe2b1c55a to your computer and use it in GitHub Desktop.
Apache
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/system [NC]
RewriteCond %{QUERY_STRING} !ACT|URL [NC]
RewriteCond %{REQUEST_METHOD} !=POST [NC]
RewriteCond $1 !\.(css|js|gif|jpe?g|png) [NC]
RewriteCond %{DOCUMENT_ROOT}/static/default_site/static%{REQUEST_URI}/index\.php -f
RewriteRule ^ /static/default_site/static%{REQUEST_URI}/index\.php [L,QSA]
</IfModule>
NGINX
if ($request_method !~* GET) {
set $request_var nonget;
}
if ($args ~* (ACT|URI)) {
set $uri_var acturl;
}
if (-e $document_root/static/default_site/static/$request_uri$request_var$uri_var/index.php) {
rewrite ^(.*) /static/default_site/static/$request_uri/index.php last;
}
Apache
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/system [NC]
RewriteCond %{QUERY_STRING} !ACT|URL [NC]
RewriteCond %{REQUEST_METHOD} !=POST [NC]
RewriteCond $1 !\.(css|js|gif|jpe?g|png) [NC]
RewriteCond %{DOCUMENT_ROOT}/STATIC_PATH/SITE_NAME/static%{REQUEST_URI}/index\.php -f
RewriteRule ^ /STATIC_PATH/SITE_NAME/static%{REQUEST_URI}/index\.php [L,QSA]
</IfModule>
NGINX
if ($request_method !~* GET) {
set $request_var nonget;
}
if ($args ~* (ACT|URI)) {
set $uri_var acturl;
}
if (-e $document_root/STATIC_PATH/SITE_NAME/static/$request_uri$request_var$uri_var/index.php) {
rewrite ^(.*) /STATIC_PATH/SITE_NAME/static/$request_uri/index.php last;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment