Answer the question
In order to leave comments, you need to log in
Relative link to index.html not working in child directory?
The link from index.html located in the root of the site to index.html in the child directory does not work. The page loads, but I still stay on the main page of the site, although the links are spelled out correctly. Most likely, you need to somehow properly configure the .htaccess file, but I have already tried many options and nothing helped. I really look forward to your help.
Here is the content of the .htaccess located at the root of the site.
Answer the question
In order to leave comments, you need to log in
I see a lot of mistakes, fix them first.
1. the host in www\.comics-man\.ru
is written with a screen of dots,
secondly, I would get rid of the domain altogether, and you need to work with https correctly.
RewriteCond %{SERVER_PORT} !^443$
RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
RewriteCond %{SERVER_PORT} ^443$
RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
RewriteCond %{REQUEST_URI} ^(.*)/index\.html$
RewriteRule ^(.*)$ %1/ [R=301,L]
############################################################################
#### Убираем повторяющиеся слеши (/) в URL ####
############################################################################
RewriteCond %{THE_REQUEST} //
RewriteRule .* /$0 [R=301,L]
############################################################################
#### Убираем слеши в конце URL для статических файлов (содержит точку) ####
############################################################################
RewriteCond %{REQUEST_URI} \..+$
# Если файл содержит точку.
RewriteCond %{REQUEST_FILENAME} !-d
# И это не директория.
RewriteCond %{REQUEST_FILENAME} -f
# Является файлом.
RewriteCond %{REQUEST_URI} ^(.+)/$
# И в конце URL есть слеш.
RewriteRule ^(.+)/$ /$1 [R=301,L]
# Исключить слеш.
############################################################################
#### Добавляем слеш(/), если его нет, и это не файл. ####
############################################################################
RewriteCond %{REQUEST_URI} !(.*)/$
# Если слеша в конце нет.
RewriteCond %{REQUEST_FILENAME} !-f
# Не является файлом.
RewriteCond %{REQUEST_URI} !\..+$
# В URL нет точки (файл).
RewriteRule ^(.*)$ $1/ [L,R=301]
<IfModule mod_deflate.c>
# Compress HTML, CSS, JavaScript, Text, XML and fonts
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE font/opentype
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE image/svg+xml
</IfModule>
<IfModule mod_expires.c>
ExpiresActive on
ExpiresByType image/jpeg "access plus 3 day"
ExpiresByType image/svg "access plus 3 day"
ExpiresByType image/gif "access plus 3 day"
ExpiresByType image/png "access plus 3 day"
ExpiresByType text/javascript "access plus 3 day"
ExpiresByType text/css "access plus 3 day"
ExpiresByType application/javascript "access plus 3 day"
</IfModule>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question