wwfc_barmy_army Posted August 18, 2009 Share Posted August 18, 2009 Hello. I have this rewrite code: Options +FollowSymLinks RewriteEngine on RewriteCond %{SCRIPT_FILENAME} !-f RewriteCond %{SCRIPT_FILENAME} !-d RewriteRule ^([0-9]+)$ index.php?id=$1 [QSA,L] RewriteRule ^([0-9]+)/([0-9]+)/([0-9]+)$ index.php?id=$1&width=$2&height=$3 [L,QSA] It works if i go to say: mydomain.com/1 but not if i go to: mydomain.com/1/ To take care of the following slash can i just do this: Options +FollowSymLinks RewriteEngine on RewriteCond %{SCRIPT_FILENAME} !-f RewriteCond %{SCRIPT_FILENAME} !-d RewriteRule ^([0-9]+)$ index.php?id=$1 [QSA,L] RewriteRule ^([0-9]+)/([0-9]+)/([0-9]+)$ index.php?id=$1&width=$2&height=$3 [L,QSA] RewriteRule ^([0-9]+)/$ index.php?id=$1 [QSA,L] RewriteRule ^([0-9]+)/([0-9]+)/([0-9]+)/$ index.php?id=$1&width=$2&height=$3 [L,QSA] Would that work or cause errors? Thanks. Link to comment https://forums.phpfreaks.com/topic/170789-rewrite-following-forward-slash/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.