Answer the question
In order to leave comments, you need to log in
Redirect in htaccess to URL without trailing slash (Bitrix)?
Good afternoon! There is a task to remove the closing slash from folders in the URL (needed for seo). Bitrix processes paths in two ways. It can be a physically existing folder on the disk that contains the index.php file and virtual paths for the CNC implementation. So, if there is a folder, for example, support, and I write example.com/support - without a slash, you need to open the index.php file in the support folder, and the slash at the end is not substituted by the server. Plus, the Bitrix CNC should work correctly. Here is the current one (aka standard bitrix htaccess)
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !/bitrix/urlrewrite.php$
RewriteRule ^(.*)$ /bitrix/urlrewrite.php [L]
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
</IfModule>
<IfModule mod_dir.c>
DirectoryIndex index.php index.html
</IfModule>
Answer the question
In order to leave comments, you need to log in
Try checking the rules for this address in urlrewrite.php and in the infoblock settings, maybe you need to fix it there.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question