31 lines
1.3 KiB
Text
31 lines
1.3 KiB
Text
DirectoryIndex index.php
|
|
|
|
<IfModule mod_rewrite.c>
|
|
RewriteEngine On
|
|
|
|
# اگه درخواست با /u شروع بشه، قوانین بعدی رو اعمال نکن و بذار فایلهای اونجا مستقیماً لود بشن
|
|
RewriteCond %{REQUEST_URI} ^/u(/|$) [NC]
|
|
RewriteRule ^ - [L]
|
|
|
|
# اگه فایل یا دایرکتوری فیزیکی وجود داره (مثل فایلهای استاتیک)، مستقیماً لودش کن
|
|
RewriteCond %{REQUEST_FILENAME} !-f
|
|
RewriteCond %{REQUEST_FILENAME} !-d
|
|
# همه درخواستهای دیگه رو به index.php سمفونی بفرست
|
|
RewriteRule ^ /index.php [L]
|
|
</IfModule>
|
|
|
|
# فعالسازی compression (اگر ماژول موجود باشد)
|
|
<IfModule mod_deflate.c>
|
|
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/json
|
|
</IfModule>
|
|
|
|
# تنظیم cache (اگر ماژول موجود باشد)
|
|
<IfModule mod_expires.c>
|
|
ExpiresActive On
|
|
ExpiresByType image/png "access plus 1 week"
|
|
ExpiresByType image/jpg "access plus 1 week"
|
|
ExpiresByType image/jpeg "access plus 1 week"
|
|
ExpiresByType text/css "access plus 1 hour"
|
|
ExpiresByType application/javascript "access plus 1 hour"
|
|
</IfModule>
|
|
|