trey/yark/master/public/.htaccess - Htaccess File

trey/yark/master/public/.htaccess

<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteBase /
  RewriteCond %{REQUEST_FILENAME} -d
  RewriteRule ^.*$ - [S=40]

# FIXME Make this redirect to pretty URLs from the real query string.
  RewriteRule ^/index.php?section=([A-Za-z0-9_]+)$ /$1/ [R]
  RewriteRule ^/index.php?section=([A-Za-z0-9_]+)&page=([A-Za-z0-9_]+)$ /$1/$2/ [R]
  RewriteRule ^/?section=([A-Za-z0-9_]+)$ /$1/ [R]
  RewriteRule ^/?section=([A-Za-z0-9_]+)&page=([A-Za-z0-9_]+)$ /$1/$2/ [R]

  RewriteRule ^([A-Za-z0-9_]+)?$ /$1/ [R] # Add trailing slash
  RewriteRule ^([A-Za-z0-9_]+)?/?$ /index.php?section=$1 [QSA,L]
  RewriteRule ^([A-Za-z0-9_]+)/([A-Za-z0-9_]+)$ /$1/$2/ [R] # Add trailing slash
  RewriteRule ^([A-Za-z0-9_]+)?/([A-Za-z0-9_]+)/?$ /index.php?section=$1&page=$2 [QSA,L]
  # RewriteRule ^(admin)?/?$ /admin/index.php [L]
</IfModule>

# If a trailing slash is omitted, add it.
# RewriteRule ^(about|books|articles)?$ /$1/ [R]
# For any existing page, rewrite /page/ to page.php.
# RewriteRule ^(about|books|articles)?/?$ /$1.php [L]
# ErrorDocument 404 /404.php

On Github License

Files

Download PDF of Htaccess file
REQUEST_FILENAME

Comments

Apache