1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1 # RewriteEngine On # RewriteCond %{HTTP:Authorization} ^(Bearer\ )(.*)$ [NC] # RewriteRule ^(.*) $1?access_token=%2 [QSA] #Header set Access-Control-Allow-Origin "*" #Header set Access-Control-Allow-Methods "GET,PUT,POST,DELETE" #Header set Access-Control-Allow-Headers "Content-Type, Authorization" <IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews </IfModule> RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://kprep.api.ozandac.com/\ [R,L] RewriteEngine On # Prevent direct access to the "public" folder - redirect to root RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /public/ RewriteRule ^public/(.*) /\ [R=302,L] # Redirect Trailing Slashes If Not A Folder... # - but look for the file in the "public" folder # (ensure we are not already in the "public" folder) RewriteCond %{REQUEST_URI} !^/public/ RewriteCond %{DOCUMENT_ROOT}/public/\ !-d RewriteRule ^(.*)/$ /\ [R=302,L] # Rewrite "everything" to the "public" subdirectory if not already # This ignores existing files/dirs in the document root RewriteCond %{REQUEST_URI} ^/(.*) RewriteRule !^public/ public/%1 # Handle Front Controller... (as before) RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index .php [L] </IfModule> |
Leave a Reply