G
G
grechinaoleg2015-09-26 01:38:12
Joomla
grechinaoleg, 2015-09-26 01:38:12

Why do Joomla urls work both with and without .html? How to fix it?

Hello!
I have Joomla 2.5.6, such functions are enabled in the settings (Enable SEF (CNC), URL Redirection, Add Suffix to URL), but links are available at several addresses, here is an example:
site.ru/stena
site.ru/stena.html
site.ru/stena.htm
How to make it redirect (preferably 301) to pages with .html?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
ramjke, 2015-09-27
@ramjke

Create a .htaccess file in the directory where the site files are located (required! file permissions 644).
Specify in the file:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^(.+)\.(html|php)$
RewriteRule . %{REQUEST_URI}.html [R=301,L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question