Rewite Rule Problem Causing 404
-
Hi. We discovered an issue where shortened URLs would return a 404 if the trailing slash was not included in the URL. I resolved this problem by making a slight modification to the rewrite rules created in the .htaccess file. I am just sharing so that these can be included in future versions, or handled in some other way to ensure the short URLs work with or without a trailing slash included.
RewriteRule ^u/([0-9]+)/?$ u.php?$1|$2The modification I made was to add the ‘?‘ before the ‘$‘ character to match on 0 or 1 trailing slash (/). We do not use the Custom Varialbes ($2) feature, so I am not sure if the modification I made breaks that functionality. Thanks!
The topic ‘Rewite Rule Problem Causing 404’ is closed to new replies.