I
I
IvanN7772015-03-02 13:49:34
Apache HTTP Server
IvanN777, 2015-03-02 13:49:34

Remove index.php from page url mode_revrite, what's wrong?

Need www.itoil.ru/***/index.php -> www.itoil.ru/***
There is a source .htaccess

Options +FollowSymLinks

ErrorDocument 401 /ru/errors/401/
ErrorDocument 403 /ru/errors/403/
ErrorDocument 404 /ru/errors/404/
ErrorDocument 500 /ru/errors/500/

RewriteEngine on
RewriteBase /

RewriteCond %{HTTP_HOST} ^www.it-oil.ru
RewriteRule ^(.*)$ http://www.itoil.ru/$1 [R=301,L]

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

#News rewrite rule
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{DOCUMENT_ROOT}ru%{REQUEST_URI} !-d
RewriteCond %{REQUEST_URI} ^/ru/news/([^\.]+)$ [OR]
RewriteCond %{REQUEST_URI} ^/news/([^\.]+)$
RewriteRule ^(.*)/(.*)$ news/index.php?id=$2&%{QUERY_STRING} [L]

#Main rewrite rule
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/ru/
RewriteRule ^(.*)$ %{DOCUMENT_ROOT}ru/$1?%{QUERY_STRING} [L]

I add
RewriteRule ^index.php$ / [QSA,R]
Options +FollowSymLinks

ErrorDocument 401 /ru/errors/401/
ErrorDocument 403 /ru/errors/403/
ErrorDocument 404 /ru/errors/404/
ErrorDocument 500 /ru/errors/500/

RewriteEngine on
RewriteBase /

RewriteCond %{HTTP_HOST} ^www.it-oil.ru
RewriteRule ^(.*)$ http://www.itoil.ru/$1 [R=301,L]

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

RewriteRule ^index.php$ / [QSA,R]

#News rewrite rule
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{DOCUMENT_ROOT}ru%{REQUEST_URI} !-d
RewriteCond %{REQUEST_URI} ^/ru/news/([^\.]+)$ [OR]
RewriteCond %{REQUEST_URI} ^/news/([^\.]+)$
RewriteRule ^(.*)/(.*)$ news/index.php?id=$2&%{QUERY_STRING} [L]

#Main rewrite rule
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/ru/
RewriteRule ^(.*)$ %{DOCUMENT_ROOT}ru/$1?%{QUERY_STRING} [L]

The method from the site tradebenefit.ru/kak-ubrat-iz-url-adresa-index-php
But it doesn't help, what's wrong?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question