mendoz Posted May 24, 2008 Share Posted May 24, 2008 Konichiwa freaks Here is my .htaccess <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /guitar/ RewriteRule ^catalog/ /guitar/dir/catalog.php [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d #wordpress RewriteRule . /guitar/index.php [L] The thing is: I want mysite.com/catalog/category to become mysite.com/catalog/category/ This shouldn't be much of an issue, right? Thanks! Link to comment https://forums.phpfreaks.com/topic/107071-solved-quick-question-add-slash-in-the-end/ Share on other sites More sharing options...
wildteen88 Posted May 24, 2008 Share Posted May 24, 2008 Add the following: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !(.*)/$ RewriteRule ^(.*)$ http://yoursite.com/$1/ [R=301,L] at the top of your .htaccess after RewriteEngine On. Change yoursite.com to your website address. This will check to see if the url ends in a / if it doesn't it'll add it in. Link to comment https://forums.phpfreaks.com/topic/107071-solved-quick-question-add-slash-in-the-end/#findComment-548913 Share on other sites More sharing options...
mendoz Posted May 24, 2008 Author Share Posted May 24, 2008 Thanks my friend, this worked: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !(.*)/$ RewriteRule ^(.*)$ $1/ [R=301,L] Link to comment https://forums.phpfreaks.com/topic/107071-solved-quick-question-add-slash-in-the-end/#findComment-548924 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.