This has been driving me a little crazy.
RewriteRule ^foo/([0-9]+)_(.+)/([0-9]+)/$ /FOO.php?p=$3&variable=$1 [NC,L]
This code creates different pages for foo/variable/page_number .. but I now list everything on foo/variable/1/ and want to redirect all the pages already indexed back to foo/variable/1/
So I thought I would write a condition as follows
RewriteCond %{QUERY_STRING} ^foo/([0-9]+)_(.+)/([0-9]+)?$ [NC]
RewriteRule ^$ /foo/$1_$2/1/ [NC,R=301,L]
RewriteRule ^foo/([0-9]+)_(.+)/(1)/$ /FOO.php? p=$3&variable=$1 [NC,L]
where I would first convert the original query to foo/variable/1/ and then rewrite that URL
but it failed.
any ideas?