Ok, so I have a url like
domain.com/item/item_id/item_description/page
when i type the link without
/page
on url it throws error 404, and I have to enter a trailing slash on url for it to work.
this is my htaccess code
Options +FollowSymLinks RewriteEngine On RewriteRule ^item/([0-9]+)/(.*)/(.*)/?$ item.php?action=item&id=$1&desc=$2&page=$3
I found this after searching:
# add trailing slash RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^.*[^/]$ /$0/ [L,R=301]
which kind of solves my problem, but how to make the trailing slash optional for the user if the user wants to add it or not, so it wonβt be redirected every time the slash is not found.
source share