A
A
agromov912020-04-29 00:24:45
Joomla
agromov91, 2020-04-29 00:24:45

Slash at the end in joomla?

I try this code, but it redirects to the main one. What am I doing wrong?

RewriteCond %{THE_REQUEST} //
RewriteRule .* /$0 [R=301,L]

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Viktor Taran, 2020-04-29
@shambler81

step
specifically what do you want to do?
get rid of double slashes?
whole file to studio

P
Pavel Gruznykh, 2020-05-11
@pavelcarcass

To get rid of trailing slashes in addresses, write in .htaccess

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R]

In the default Joomla .htaccess file, these lines must be inserted in a strictly defined place:
## Begin - Custom redirects
#
# If you need to redirect some pages, or set a canonical non-www to
# www redirect (or vice versa), place that code here. Ensure those
# redirects use the correct RewriteRule syntax and the [R=301,L] flags.
#
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R]
## End - Custom redirects

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question