Title: Rewite Rule Problem Causing 404
Last modified: August 21, 2016

---

# Rewite Rule Problem Causing 404

 *  Resolved [William Rettmann](https://wordpress.org/support/users/whirled/)
 * (@whirled)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/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|$2`
 * The 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!
 * [http://wordpress.org/extend/plugins/shorten-url/](http://wordpress.org/extend/plugins/shorten-url/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Sed Lex](https://wordpress.org/support/users/sedlex/)
 * (@sedlex)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/rewite-rule-problem-causing-404/#post-3664149)
 * Hum… not sure to understand.
 * Could you give me an example of an url that do not have any trailing slash and
   cause a 404 issue ?
 * I will try to correct it if there is a bug
 *  [Sed Lex](https://wordpress.org/support/users/sedlex/)
 * (@sedlex)
 * [13 years ago](https://wordpress.org/support/topic/rewite-rule-problem-causing-404/#post-3664514)
 * If you have additional information to give please tell me

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Rewite Rule Problem Causing 404’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/shorten-url_ffffff.svg)
 * [Short URL](https://wordpress.org/plugins/shorten-url/)
 * [Support Threads](https://wordpress.org/support/plugin/shorten-url/)
 * [Active Topics](https://wordpress.org/support/plugin/shorten-url/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/shorten-url/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/shorten-url/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Sed Lex](https://wordpress.org/support/users/sedlex/)
 * Last activity: [13 years ago](https://wordpress.org/support/topic/rewite-rule-problem-causing-404/#post-3664514)
 * Status: resolved