Если вам нравится SbUP Форум, вы можете поддержать его - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 и ещё....

 

Как избавиться от "/index.php"

Автор Tazit, 09-10-2016, 11:34:17

« назад - далее »

TazitTopic starter

Цитата: Krokodilchik от 09-10-2016, 17:17:17RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ http://site.ru/ [R=301,L]

Сделал.
Теперь из меню не включается главная страница, все остальные так и работают с "/index.php".

  •  


Clever

Попробуйте такой вариант для исключения index.php, index.html, index.htm:
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.(php|html|htm)\ HTTP/
RewriteRule ^(.*)$ http://%{HTTP_HOST} [R=301,L]


mihadmitriev

# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script
RewriteCond %{REQUEST_URI} !^/index\.php
# and the requested path and file doesn't directly match a physical file
RewriteCond %{REQUEST_FILENAME} !-f
# and the requested path and file doesn't directly match a physical folder
RewriteCond %{REQUEST_FILENAME} !-d
# internally rewrite the request to the index.php script
RewriteRule .* index.php [L]
  •  

Arb

Зайди в настройки, включи SEF-урлы для чистых ссылок. Потом проверь .htaccess - там нужен редирект для удаления "index.php". Если не хочешь ковыряться в коде, юзай плагины типа RSSEO или SH404SEF – они всё настроят за тебя.
  •  



Если вам нравится SbUP Форум, вы можете поддержать его - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 и ещё....