Hullas .htaccess ga http pratakoldan https pratakolga yo’lash uchun kod yozilgan i other/page.php ni page.php ga alishtirish kodi yozilgan shu htaccess orqali urli taxrirlangan sahifaga http pratakol bilan kirilganda sahifani asl urlni sotib qo’yayabdi
Masalan http://uzfor.uz/chat.php ga kirsez httрs://uzfor.uz/pages/chat.php ga tushas, men buni o’zimda sinab ko’rmadim i uzforda bu qanaqa yozilgan bilmayman sizlar bu nimadan deb o’ylaysizlar?
kHakimzhon, # kHakimzhon (21.04.2020 / 19:53)
Hullas .htaccess ga http pratakoldan https pratakolga yo’lash uchun kod yozilgan i other/page.php ni page.php ga alishtirish kodi yozilgan shu htaccess orqali urli taxrirlangan sahifaga http pratakol Siz xato qilgansiz
Akbarali, # Akbarali (01.06.2020 / 12:19)
TimX, Мен ишлатаётганим
HTTPS
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQMen so'ragan narsa bunaqa yozilmasligini judayam yaxshi bilib turibsizku
Akbarali, # Akbarali (01.06.2020 / 18:42)
TimX, нимани сураган эдингиз ?SEO uchun 301 redirect. www ni http:// qilib o'zgartiradigan. Masalan: www.site.uz emas http://site.uz bo'lishi kerak. Agar ushbu redirect sozlanmasa, qidiruv tizimlari bu ikkisini ikki xil sayt sifatida qabul qiladi. Bu esa SEO uchun minus
kHakimzhon, # kHakimzhon (21.04.2020 / 19:53)
Hullas .htaccess ga http pratakoldan https pratakolga yo’lash uchun kod yozilgan i other/page.php ni page.php ga alishtirish kodi yozilgan shu htaccess orqali urli taxrirlangan sahifaga http pratakol .htaccess orqali URL nomini o'zgartirish:
bu koddan keyin www.sayt.com/jild/muqova.php joriy manzilga o'zgaradi: sayt.com/muqova.php
manimcha siz shuni suragansiz bu bumasa uzur 98 kun 23 soat 40 daqiqa 9 soniyadan keyin yozdi:
https ni ololmayapman yordam kerak
shundan keyin buni yozsam sayt ishlamay qolyapti
maqsadim https olish ssl sertitikat olingan
0
Kod · PHP1 qator
RewriteRule ^muqova.php$ /jild/muqova.php [L]
Kod · PHP107 qator
Options -Indexes
ErrorDocument 402 /?err
ErrorDocument 403 /?err
ErrorDocument 404 /?err
ErrorDocument 500 /?err
DirectoryIndex index.php
RemoveHandler .phtml .php3 .php4 .php5 .php6 .phps .cgi .pl .asp .aspx .shtml .shtm .fcgi .fpl .jsp .py
AddType application/x-httpd-php-source .phtml .php3 .php4 .php5 .php6 .phps .cgi .pl .asp .aspx .shtml .shtm .fcgi .fpl .jsp .py
AddDefaultCharset UTF-8
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 1 month"
# CSS
ExpiresByType text/css "access plus 1 year"
# Data interchange
ExpiresByType application/json "access plus 0 seconds"
ExpiresByType application/ld+json "access plus 0 seconds"
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType text/xml "access plus 0 seconds"
# Favicon (cannot be renamed!) and cursor images
ExpiresByType image/x-icon "access plus 1 week"
# HTML components (HTCs)
ExpiresByType text/x-component "access plus 1 month"
# HTML
ExpiresByType text/html "access plus 0 seconds"
# JavaScript
ExpiresByType application/javascript "access plus 1 year"
# Manifest files
ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds"
ExpiresByType text/cache-manifest "access plus 0 seconds"
# Media
ExpiresByType audio/ogg "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType video/mp4 "access plus 1 month"
ExpiresByType video/ogg "access plus 1 month"
ExpiresByType video/webm "access plus 1 month"
# Web feeds
ExpiresByType application/atom+xml "access plus 1 hour"
ExpiresByType application/rss+xml "access plus 1 hour"
</IfModule>
Kod · PHP5 qator
RewriteEngine On
RewriteCond %{HTTPS}!on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
Hullas, RewriteRule orqali "domain.com/info.php" "domain.com/info" ga yo'naltirilgan, agar ohiriga slash qo'yib "domain.com/info/" kirilsa 404 ga jo'natib yuboryabdi bunaqa RewriteRulelar juda ko'p shuni bittada slashsiz ham slash bilan ham kiradigon qilish kerak. Harnarsa qib ko'rdim
Kradoff ⁾, # Kradoff ⁾ (20.11.2021 / 05:08)
Hullas, RewriteRule orqali "domain.com/info.php" "domain.com/info" ga yo'naltirilgan, agar ohiriga slash qo'yib "domain.com/info/" kirilsa 404 ga jo'natib yuboryabdi bunaqa RewriteRulelar juda ko'p sh$ belgisi oldidan ? belgisini qo'shib qo'ysangiz, ya'ni bunday holatda ?$ o'sha sahifaga slash qo'ysangiz ham, qo'ymasangiz ham ishlayveradi.