-
-
Save desbest/11036be380270a7e6001 to your computer and use it in GitHub Desktop.
portfolio htaccess. attempt 2 (breaks my site)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine on | |
# Some hosts require a rewritebase rule, if so, uncomment the RewriteBase line below. If you are running from a subdirectory, your rewritebase should match the name of the path to where stacey is stored. | |
# ie. if in a folder named 'stacey', RewriteBase /stacey | |
# RewriteBase / | |
#ErrorDocument 404 /404.html | |
# Rewrite any calls to *.html, *.json, *.xml, *.atom, *.rss, *.rdf or *.txt if a folder matching * exists | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_URI} !public/ | |
RewriteCond %{DOCUMENT_ROOT}/public/$1.$2 !-f | |
RewriteRule (.+)\.(html|json|xml|atom|rss|rdf|txt)$ $1/ [L] | |
# Add a trailing slash to directories | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_URI} !(\.) | |
RewriteCond %{REQUEST_URI} !(.*)/$ | |
RewriteRule ([^/]+)$ $1/ [L] | |
# Rewrite any calls to /* or /app to the index.php file | |
RewriteCond %{REQUEST_URI} /app/$ | |
#desbest edit | |
RewriteCond !%{REQUEST_URI} /projects/clickrobot/$ | |
RewriteRule ^app/ index.php [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
#desbest edit | |
RewriteCond !%{REQUEST_URI} /projects/clickrobot/$ | |
RewriteRule ^(.*)/$ index.php?$1 [L] | |
# Rewrite /projects/* to /content/projects/* | |
RewriteRule ^(projects/.*)$ /content/$1 [L,NC,R=302] | |
# Rewrite any file calls to the public directory | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_URI} !public/ | |
#desbest edit | |
RewriteCond !%{REQUEST_URI} /projects/clickrobot/$ | |
RewriteRule ^(.+)$ public/$1 [L] | |
## rewrite /*/ to /content/public/work/* | |
# If the request is not for a valid directory | |
#RewriteCond %{REQUEST_FILENAME} !-d | |
# If the request is not for a valid file | |
#RewriteCond %{REQUEST_FILENAME} !-f | |
#RewriteRule ^((?!content/work/).*) content/work/$1 [L,NC] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment