cristianchaparroa/uifi/master/web/.htaccess - Htaccess File

cristianchaparroa/uifi/master/web/.htaccess

# Use the front controller as index file. It serves as a fallback solution when
# every other rewrite/redirect fails (e.g. in an aliased environment without
# mod_rewrite). Additionally, this reduces the matching process for the
# start page (path "/") because otherwise Apache will apply the rewriting rules
# to each configured DirectoryIndex file (e.g. index.php, index.html, index.pl).
DirectoryIndex app.php

<IfModule mod_rewrite.c>
    Options +FollowSymlinks
     RewriteEngine On

     # Explicitly disable rewriting for front controllers
     RewriteRule ^/web/app_dev.php - [L]
     RewriteRule ^/web/app.php - [L]

     # Fix the bundles folder
     RewriteRule ^bundles/(.*)$ /web/bundles/$1  [QSA,L]

     RewriteCond %{REQUEST_FILENAME} !-f
     # Change below before deploying to production
     #RewriteRule ^(.*)$ /web/app.php [QSA,L]
     RewriteRule ^(.*)$ /web/app_dev.php [QSA,L]
</IfModule>

<IfModule !mod_rewrite.c>
    <IfModule mod_alias.c>
        # When mod_rewrite is not available, we instruct a temporary redirect of
        # the start page to the front controller explicitly so that the website
        # and the generated links can still be used.
        RedirectMatch 302 ^/$ /app.php/
        # RedirectTemp cannot be used instead
    </IfModule>
</IfModule>

RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule ^(.*)$ $1 [R=200,L]

<IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
    Header always set Access-Control-Allow-Methods "POST, GET, PUT, DELETE, OPTIONS"
    Header always set Access-Control-Allow-Headers "X-Requested-With, content-type"
</IfModule>

On Github License

Files

Download PDF of Htaccess file
GET, POST, PUT, REQUEST_FILENAME, REQUEST_METHOD, X-Requested-With

Comments

Apache