Как убрать index.html из URL?

Здравствуйте, подскажите, как убрать index.html из URL через .htaccess, пытался сам написать, но ничего не работает, подскажите, как убрать его или где я допустил ошибку ?
calibri.ca
Options All  -Indexes -Includes +FollowSymLinks

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteBase /
    RewriteCond %{HTTP_HOST} ^calibri.ca
    RewriteRule (.*) http://www.letsdothat.16mb.com/$1 [R=301,L]
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
    RewriteRule ^index\.php$ http://www.calibri.ca/ [R=301,L]
    RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^resource/(.*)$ resource/$1 [L]
RewriteRule ^.*$ [NC,L]
RewriteRule ^.*$ index.php [NC,L]
</IfModule>

DirectoryIndex index.php
    

<IfModule mod_setenvif.c>
    SetEnv TZ Europe/Moscow
</IfModule>
ServerSignature Off
AddDefaultCharset UTF-8
<ifModule mod_php.c>
    php_value	upload_max_filesize	32M
    php_value	post_max_size		10M
    php_value	default_charset utf-8
    php_value	max_execution_time 200
</ifModule>
AddHandler application/x-httpd-php .html
AddHandler cgi-script .pl .py .jsp .asp .htm .shtml .sh .cgi
AddType application/x-javascript .js
AddType text/css .css
AddType text/xml .xml
AddType application/octet-stream .doc .mov .avi .pdf .xls 
# ForceType application/x-httpd-php

<ifModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/css text/javascript application/javascript application/x-javascript
</ifModule>

<IfModule mod_gzip.c>
    mod_gzip_on         Yes
    mod_gzip_dechunk    Yes
    mod_gzip_item_include file		\.(html?|txt|css|js|php|pl)$
    mod_gzip_item_include mime		^text\.*
    mod_gzip_item_include mime		^application/x-javascript.*
    mod_gzip_item_exclude mime		^image\.*
    mod_gzip_item_exclude rspheader	^Content-Encoding:.*gzip.*
</IfModule>

# Bad Rquest
ErrorDocument 400 /400.html
# Authorization Required
ErrorDocument 401 /401.html
# Forbidden
ErrorDocument 403 /403.html
# Not found
ErrorDocument 404 /404.html
# Method Not Allowed
ErrorDocument 405 /405.html
# Request Timed Out
ErrorDocument 408 /408.html
# Request URI Too Long
ErrorDocument 414 /414.html
# Internal Server Error
ErrorDocument 500 /500.html
# Not Implemented
ErrorDocument 501 /501.html
# Bad Gateway 
ErrorDocument 502 /502.html
# Service Unavailable 
ErrorDocument 503 /503.html
# Gateway Timeout
ErrorDocument 504 /504.html
  • Вопрос задан
  • 2429 просмотров
Решения вопроса 1
Zettabyte
@Zettabyte
Проф. восстановление данных ▪ Вопрос? См. профиль
Для начала, на всякий случай, вопрос: вы убираете index.html или index.php?

Для первого пробуйте вот такое, не забыв про http/https:
<IfModule mod_rewrite.c> 
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.html\ HTTP/ 
RewriteRule ^index\.html$ http://%{HTTP_HOST}/ [R=301,L]
</IfModule>
Ответ написан
Пригласить эксперта
Ответы на вопрос 1
@godfathernn
Так должно сработать:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы