RewriteEngine On
RewriteRule ^([^/]*)/([^/]*)$ /dir/index.php?category=$1&link=$2 [L]
RewriteCond %{REQUEST_URI} !\.[^./]+$
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ http://www.mydomain.com/dir/$1/$2 [R=301,L]
I'm having a problem with this one, I hope someone will help me.
www.domain.com/dir/category/
works well, but when it comes to a second variable
www.domain.com/dir/category/variable/
it doesn't work, but if I remove the last slash, it works...
EDIT----------------------------
This works fine so far.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]*)/([^/]*)/?$ /dir/index.php?category=$1&link=$2 [L]
RewriteCond %{REQUEST_URI} !\.[^./]+$
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ http://www.omain.com/dir/$1/$2 [R=301,L]