I have this rewrite code:
- Code: Select all
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:
- Code: Select all
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.