vojtechkral/rodokmen/master/.htaccess - Htaccess File

vojtechkral/rodokmen/master/.htaccess

# Rodokmen .htaccess file
# Facilitates rewrites of appliaction requests,
# as well as resources and media requests,
# and also denies access to physical files except when whitelisted

# Thanks to:
# http://www.zeilenwechsel.de/it/articles/8/Using-mod_rewrite-in-.htaccess-files-without-knowing-the-RewriteBase.html

RewriteEngine On
RewriteBase /

# Rewrite for webpage resources:
# Resource extensions are whitelisted
# Resource subdirectory is designated according to extension
# (See also comment in router_main.php)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond $1 ^rs/.*[.]css$  [OR]
RewriteCond $1 ^rs/.*[.]js$   [OR]
RewriteCond $1 ^rs/.*[.]png$  [OR]
RewriteCond $1 ^rs/.*[.]svg$  [OR]
RewriteCond $1 ^rs/.*[.]gif$
RewriteCond $1#%{REQUEST_URI} rs/([^#]*)[.]([^#]*)#(.*)rs/1[.]2$
RewriteRule ^(.*)$ %3view/rs/%2/%1.%2 [L]

# Rewrite for media:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond $1 ^media/..*$
RewriteCond $1#%{REQUEST_URI} ([^#]*)#(.*)1$
RewriteRule ^(.*)$ %2data/$1 [L]

# Rewrite for everything virtual:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond $1#%{REQUEST_URI} ([^#]*)#(.*)1$
RewriteRule ^(.*)$ %2index.php [QSA,L]

# Existing paths are forwarded to index.php as well,
# except whitelisted ones (index.php itself, rs, and media):
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond $1 !^index.php$
RewriteCond $1 !^view/rs/.*$
RewriteCond $1 !^data/media/.*$
RewriteCond $1#%{REQUEST_URI} ([^#]*)#(.*)1$
RewriteRule ^(.*)$ %2index.php [QSA,L]

On Github License

Files

Download PDF of Htaccess file
REQUEST_FILENAME, REQUEST_URI

Comments

Apache