Forum Moderators: phranque

Message Too Old, No Replies

Used to paginate using htaccess now I want to redirect indexed pages

dynamic url redirect

         

stupidzbu

7:47 am on Jan 4, 2011 (gmt 0)

10+ Year Member



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?

stupidzbu

4:56 am on Jan 5, 2011 (gmt 0)

10+ Year Member



No one can help?

jdMorgan

8:27 pm on Jan 5, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Duplicate thread: Please see [webmasterworld.com...]

Jim