stephengardner/ngQuotogenic/master/app/.htaccess - Htaccess File

stephengardner/ngQuotogenic/master/app/.htaccess

#Gzip
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript text/javascript
</ifmodule>
#End Gzip

RewriteEngine on

# RewriteBase equivalent - Production
RewriteCond %{HTTP_HOST} !^localhost$
RewriteRule . - [E=REWRITEBASE:/public_html/]

# RewriteBase equivalent - Development
RewriteCond %{HTTP_HOST} ^localhost$
RewriteRule . - [E=REWRITEBASE:/public_html/]

RewriteRule ^/quote/([0-9]+)$ /quote.php?quoteID=$1
RewriteRule ^/quote/([0-9]+)$ /quote.php?quoteID=$1
#RewriteRule ^quote.php$ /index.php

#main API
RewriteRule api/v2/(?!js)(.*)$ api/v2/api.php?request=$1 [QSA,NC,L]

# instagram bot API
RewriteRule instagram_v2/api/v1/(?!js)(.*)$ instagram_v2/api/v1/api.php?request=$1 [QSA,NC,L]

ErrorDocument 403 /forbidden.php
ErrorDocument 404 /404.php

# prevent viewing of a specific file
<files php.ini>
 order allow,deny
 deny from all
</files>

RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

#
# Rewrite contact to contact-us.php version
#
RewriteRule ^contact/success$ contact-us.php?message=Message+Sent!
RewriteRule ^contact$ %{ENV:REWRITEBASE}/contact-us.php

#
# Rewrite account to users/account/settings.php version
#
RewriteRule ^account$ %{ENV:REWRITEBASE}/users/account/settings.php

#
# Rewrite account to users/account/dashboard.php version
#
RewriteRule ^dashboard$ %{ENV:REWRITEBASE}/users/account/dashboard.php

#
# Rewrite account to users/account/favorites.php version
#
RewriteRule ^favorites$ %{ENV:REWRITEBASE}/users/account/favorites.php

#
# Rewrite account to users/account/favorites.php version
#
RewriteRule ^favorites/([0-9]+)/?(.*)$ %{ENV:REWRITEBASE}/users/account/favorite-list.php?listID=$1

#the following line WORKS 12/13/13
#
# Rewrite authors/author-id/author-name to queried .php? version
#
RewriteRule ^authors/([0-9]+)/?(.*)$ %{ENV:REWRITEBASE}/author.php?authorID=$1

#
# Rewrite authors/author-name to queried .php? version
#
RewriteRule ^authors/([^/]*)/?$ %{ENV:REWRITEBASE}/author.php?author=$1  [R=301,L]

#
# Rewrite tags/tagID to queried .php? version
#
RewriteRule ^tags/([0-9]+)/?(.*)$ %{ENV:REWRITEBASE}/tag.php?tagID=$1

#
# Rewrite quotes to standard quotes.php
#
RewriteRule ^quotes$ %{ENV:REWRITEBASE}/feed-quotes.php

#
# Rewrite photos to standard photos.php
#
RewriteRule ^photos$ %{ENV:REWRITEBASE}/feed-photos.php

#
# Rewrite photos to standard photos.php
#
RewriteRule ^photos/submit$ %{ENV:REWRITEBASE}/feed-quotes.php?error=submit

#
# Rewrite videos to standard videos.php
#
RewriteRule ^videos$ %{ENV:REWRITEBASE}/feed-videos.php

#
# Rewrite quotes/quote-id/quote-text to queried .php? version
#
RewriteRule ^quotes/([0-9]+)?/?(.*)$ %{ENV:REWRITEBASE}/quote.php?quoteID=$1

#
# Rewrite titles/title-id/title-text to queried .php? version
#
RewriteRule ^titles/([0-9]+)?/?(.*)$ %{ENV:REWRITEBASE}/title.php?titleID=$1

#
# Rewrite (photos) quotographs/photoMapID/ to queried .php? version
#
RewriteRule ^quotographs/([0-9]+)?/?(.*)$ %{ENV:REWRITEBASE}/photo.php?photoMapID=$1

#
# Rewrite submit/photoMapID/ to queried .php? version
#
RewriteRule ^submit-quote/?$ %{ENV:REWRITEBASE}/submitQuote.php

#
# Rewrite submit/photoMapID/ to queried .php? version
#
RewriteRule ^submit/([0-9]+)?/?(.*)$ %{ENV:REWRITEBASE}/submitPhoto.php?quoteID=$1

# removed -- gives problems with .php pages like instagram-redirect-handler.php, could change this if i specify rediects for all pages instead of .php....
#RewriteCond %{THE_REQUEST} ^[A-Z]{3,9} /([^/]+).php
#RewriteRule ^ /%1/ [L,R=301]

On Github License

Files

Download PDF of Htaccess file
DEFLATE, ENV, HTTP_HOST, HTTPS, REQUEST_URI, REWRITEBASE, THE_REQUEST

Comments

Apache