Posted by
The Code Post
on
- Get link
- X
- Other Apps
1. API Sunucusunda .htaccess Dosyası Nasıl Olmalı
###############################################
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Header always set Content-Security-Policy: upgrade-insecure-requests
RewriteEngine On
############ANA ADRESE GIDINCE WEB KLASORU ICINDEKI LANDING PAGE I GORSUNLER
# # Map http://www.example.com to /jekyll.
# RewriteRule ^$ /web/ [L]
# # Map http://www.example.com/x to /jekyll/x unless there is a x in the web root.
# RewriteCond %{REQUEST_FILENAME} !-f
# RewriteCond %{REQUEST_FILENAME} !-d
# RewriteCond %{REQUEST_URI} !^/web/
# RewriteRule ^(.*)$ /web/$1
# # Add trailing slash to directories within jekyll
# # This does not expose the internal URL.
# RewriteCond %{SCRIPT_FILENAME} -d
# RewriteRule ^web/(.*[^/])$ https://app.proctorstone.com/$1/ [R=301]
################### DOSYALARA DOGRUDAN ULASAMASINLAR
# BU YONTEMLE VIDEOPLAYER SRC SINI DEGISTIRIP ISTEDIKLERI DOSYAYA
# BU SEKILDE ULASABILIRLER.
# BU YUZDEN uploads KLASORU ICINDE DENY FROM ALL
# OLUSTURULUP MEDYA DOSYALAR view.php UZERINDEN GORUNTULENECEK
# SEKILDE DUZENLENDI
# enable mod_rewrite
RewriteEngine On
# RewriteCond = define rule condition
# HTTP_REFERER = check from where the request originated
# ! = exclude
# ^ = start of string
# [NC] = case insensitive search
RewriteCond %{HTTP_REFERER} !^https://app.proctorstone.com [NC]
# \ = match any
# . = any character
# () = pattern, group
# $ = end of string
# [F] = forbidden, 403
# [L] = stop processing further rules
RewriteRule \.(mp4|mov|mkv|flv|webm)$ - [F,L]
################### API HABERLESMESI ICIN ######################
<IfModule mod_headers.c>
#CORS HABERLESMESI ICIN
Header set Access-Control-Allow-Origin "*"
#X-CSRF HATASI ICIN
Header set Access-Control-Allow-Headers "*"
</IfModule>
################### API HABERLESMESI ICIN ######################
################### POST LIMITINI ARTIRMAK ICIN ######################
php_value upload_max_filesize 2000M
php_value post_max_size 2000M
################### POST LIMITINI ARTIRMAK ICIN
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php74” package as the default “PHP” programming language.
<IfModule mime_module>
AddHandler application/x-httpd-ea-php74___lsphp .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
2. Headerla ilgili hatalar PHP dosyası içinden de düzeltilebilir. Fakat hem .htaccess içinde hem de php içinde aynı header kullanılırsa hata verir. O yüzden ya php içinde, ya da .htaccess içinde aynı header bir defa kullanılmalı.
Comments
Post a Comment