+1 vote
ago by
Good day! The challenge is to remove the closing slash from folders in the URL (necessary for seo). Bitrix handle paths in two ways. This can be a physically existing folder on disk into which a file index.php and virtual path for the implementation of the CNC. So, if there is a support folder for example and I write example.com/support - without the slash, you need to open the file index.php in the support folder, the slash in the end was not specified by the server. Plus everything should work correctly CNC Bitrix. Here is the current (aka standard vitrectomy 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>
Actually it's simple, if not a file/folder/link redirect to urlrewrite.php which processes virtual address. Found such a thing as DirectorySlash Off, you do not know something or not but at least it's not directed to the url with slalom, but it gives a 403 error. Please help, I was exhausted!

1 Answer

0 votes
ago by
Try to check the rules for this address urlrewrite.php and in the settings of the information block may need to be corrected there.
ago by
You do not quite understand correctly. I need to remove the redirect to the url with a closing slash only for physically existing folders. By default, mod_dir just when asked to www.example.com/dirname redirects to www.example.com/dirname/ I need to disable this redirect to upon request www.example.com/dirname opened the index page in this folder. urlrewrite.php nothing to do with. He only handles virtual addresses.
...