pierodetomi/mphasy/master/lib/.htaccess - Htaccess File

pierodetomi/mphasy/master/lib/.htaccess

# ==========================================================
# Copyright 2013 Piero De Tomi
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==========================================================
 
<IfModule mod_rewrite.c>
RewriteEngine On

RewriteBase /

#ErrorDocument 400 /error/bad-request.html
#ErrorDocument 401 /error/unauthorised.html
#ErrorDocument 403 /error/forbidden.html
ErrorDocument 404                    _sys/views/404.html
#ErrorDocument 500 /error/internal-server-error.html

# "Exception" rule for 404 default page image
RewriteRule ^_sys/views/sad.png$            _sys/views/sad.png [NC,L]

# Resources URLs
RewriteRule ^(.+)/img/(.+)$                img/$2 [NC,L]
RewriteRule ^(.+)/js/(.+)$                js/$2 [NC,L]
RewriteRule ^(.+)/css/(.+)$                css/$2 [NC,L]

#            controller  / view       / params
RewriteRule ^([a-z0-9_]+)/([a-z0-9_]+)/(.+)$      index.php?viewModel=$1&view=$2&prms=$3 [NC,L]

#            controller  / view
RewriteRule ^([a-z0-9_]+)/([a-z0-9_]+)/?$        index.php?viewModel=$1&view=$2 [NC,L]

#            controller  / Index
RewriteRule ^([a-z0-9_]+)/?$              index.php?viewModel=&view= [NC,L] #this will intentionally cause a 404 error

#      root
RewriteRule ^/$                      index.php [NC,L] #this will show the default view configured by the user

</IfModule>

On Github License

Files

Download PDF of Htaccess file

Comments

Apache