2013-10-15 2 views
0

Я хочу добиться 2 вещи с моей .htaccess:.htaccess: удалить index.php и перенаправить WWW

1) Удалите index.php из URL (website.com/index.php/clases/ в site.com/clases/) 2) Перенаправить все URL-адреса с сайта www.website.com

Проблема: это то, что когда я вхожу, сайт.com перенаправляет меня на www.website.com /index.php, указав только URL-адрес без индекса.

RewriteEngine on 
RewriteCond %{HTTP_HOST} !^www\. 
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] 

Options All -Indexes 

#RewriteBase /var/www/html/ci_yosoyprofe/ 

RewriteCond $1 !^(index\.php|js|media|uploads|assets|t|html|tmp|images|systems\/plugins|static|robots\.txt|css\/) 

RewriteRule ^(.*)$ index.php/$1 [L] 

ответ

0

Имейте ваше правило так:

Options All -Indexes 
DirectoryIndex index.php 

RewriteEngine on 
RewriteCond %{HTTP_HOST} !^www\. [NC] 
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] 

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond $1 !^(index\.php|js|media|uploads|assets|t|html|tmp|images|systems/plugins|static|robots\.txt|css/) 
RewriteRule ^(.+)$ index.php/$1 [L] 
Смежные вопросы