bash remove trailing slash
VALUE=/looks/like/a/path///
TRIMMED=$(echo $VALUE | sed 's:/*$::')
echo $VALUE $TRIMMED
bash remove trailing slash
VALUE=/looks/like/a/path///
TRIMMED=$(echo $VALUE | sed 's:/*$::')
echo $VALUE $TRIMMED
Remove .php extension & Remove trailing slash
RewriteCond %{THE_REQUEST} ^.*/index.php
RewriteRule ^(.*)index.php$ /$1 [R=301,L]
RewriteCond %{THE_REQUEST} /([^.]+).php [NC]
RewriteRule ^ /%1 [R=301,NC,L,R]
RewriteRule ^(.*)/(?.*)?$ $1$2 [R=301,L]
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^ %{REQUEST_URI}.php [NC,L]
how to remove double slash from the url with .htaccess
<IfModule mod_rewrite.c>
RewriteBase /
# rule 1: remove multiple leading slashes (directly after the TLD)
RewriteCond %{THE_REQUEST} s/{2,}
RewriteRule (.*) $1 [R=301,L]
# rule 2: remove multiple slashes in the requested path
RewriteCond %{REQUEST_URI} ^(.*)/{2,}(.*)$
RewriteRule (.*) %1/%2 [R=301,L]
</IfModule>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us