A
A
alex9212018-08-20 21:15:50
1C-Bitrix
alex921, 2018-08-20 21:15:50

Redirect from index pages (.html and .php) not configured correctly?

Hello! You need to redirect from https://site.ua/index.html to catalog https://site.ua/. I know what can be found in Google, but all the examples that I found do not work.
Found this code:

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

Now, if you write index.php index.html on any page, then a redirect occurs, BUT this does not affect the main page - https://example.ua/index.html opens. Please tell me how to solve this problem.
ENGINE -- BITRIX

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry, 2018-08-20
@slo_nik

Good evening.

RewriteEngine On
RewriteCond %{REQUEST_URI} /index\.php\ HTTP/
RewriteRule ^index\.php$ http://%{HTTP_HOST}/ [R=301,L]

A
Alex-1917, 2018-08-20
@alex-1917

Most likely you have created a static page called index.html, other options just don't come to mind.
Remove this nonsense (stat. page index.html) and everything will be good!
And yes - take Bitrix developer courses, it's not long, but sensible!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question