Помощник
|
Как убрать index.html на сайте? |
romand777
|
Сообщение
#1
|
||
|
|
||
|
|||
x64 |
16.7.2014, 22:48;
Ответить: x64
Сообщение
#2
|
|
а вы что, хотите, чтобы на любой странице был адрес http://site.ru/ ?
|
|
|
maxogo |
16.7.2014, 23:05;
Ответить: maxogo
Сообщение
#3
|
|
Для главной:
Код RewriteEngine On RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.html\ HTTP/ RewriteRule ^index\.html$ / [R=301,L] Для второстепенных: Код RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.html -f RewriteRule ^(.*)$ $1.html в .htaccess Сообщение отредактировал maxogo - 16.7.2014, 23:10 |
|
|
romand777
|
Сообщение
#4
|
|
maxogo, Выдал ошибку при открытии сайта
Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, you@example.com and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. |
|
|
maxogo |
17.7.2014, 0:42;
Ответить: maxogo
Сообщение
#5
|
|
|
Тогда так:
Код RewriteEngine on RewriteBase / RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^.]+)\.html\ HTTP RewriteRule ^([^.]+)\.html$ http://site/$1 [R=301,L] RewriteCond %{REQUEST_URI} !(\.[^./]+)$ RewriteCond %{REQUEST_fileNAME} !-d RewriteCond %{REQUEST_fileNAME} !-f RewriteRule (.*) /$1.html [L] вместо site, впишите свой домен
|
|
|
||
|
Похожие темы
Тема | Ответов | Автор | Просмотров | Последний ответ | |
---|---|---|---|---|---|
Странный трафик на сайте длительное время | 34 | TABAK | 9136 | 24.4.2024, 23:38 автор: Arsenwenger |
|
Как в пушсетках покупают по 100-200 тысяч кликов за день? | 2 | Boymaster | 716 | 24.4.2024, 17:52 автор: Boymaster |
|
CryptoCloud — прием USDT, BTC, ETH, LTC на любом сайте | 37 | CryptoCLoud | 10830 | 24.4.2024, 15:37 автор: CryptoCLoud |
|
Боты могут делать пушподписки на моём сайте? | 3 | Megaspryt | 986 | 24.4.2024, 5:18 автор: Skyworker |
|
Как вы отдыхаете от работы за компом | 151 | adw-kupon.ru | 19904 | 23.4.2024, 13:52 автор: Vmir |
Текстовая версия | Сейчас: 26.4.2024, 0:39 |