Forum Moderators: phranque
[size=2]
#Category Rewrites
#Jewelry
RewriteCond %{QUERY_STRING} ^pg=1$ [NC]
RewriteRule ^jewelry\.asp$ http://www.example.com/index.php?_a=viewCat&catId=1&page=0 [NC,L]
RewriteCond %{QUERY_STRING} ^pg=2$ [NC]
RewriteRule ^jewelry\.asp$ http://www.example.com/index.php?_a=viewCat&catId=1&page=1 [NC,L]
RewriteCond %{QUERY_STRING} ^pg=3$ [NC]
RewriteRule ^jewelry\.asp$ http://www.example.com/index.php?_a=viewCat&catId=1&page=2 [NC,L]
RewriteCond %{QUERY_STRING} ^pg=4$ [NC]
RewriteRule ^jewelry\.asp$ http://www.example.com/index.php?_a=viewCat&catId=1&page=3 [NC,L]
RewriteCond %{QUERY_STRING} ^pg=5$ [NC]
RewriteRule ^jewelry\.asp$ http://www.example.com/index.php?_a=viewCat&catId=1&page=4 [NC,L]
RewriteCond %{QUERY_STRING} ^pg=6$ [NC]
RewriteRule ^jewelry\.asp$ http://www.example.com/index.php?_a=viewCat&catId=1&page=5 [NC,L]
RewriteCond %{QUERY_STRING} ^pg=7$ [NC]
RewriteRule ^jewelry\.asp$ http://www.example.com/index.php?_a=viewCat&catId=1&page=6 [NC,L]
RewriteRule ^jewelry.asp$ http://www.example.com/index.php?_a=viewCat&catId=1&page=0 [NC,L]
[/size] [size=2]
url.asp?pg=1 rewrites to a=viewCat&catId=1&page=0
url.asp?pg=2 rewrites to a=viewCat&catId=1&page=1
url.asp?pg=2 rewrites to a=viewCat&catId=1&page=2
etc..etc...until
url.asp rewrites to a=viewCat&catId=1&page=0
[/size] [edited by: jdMorgan at 10:29 pm (utc) on Apr 14, 2010]
[edit reason] Please use example.com only. [/edit]
RewriteCond %{QUERY_STRING} ^pg=[b]([0-9]+)[/b]$
RewriteRule ^jewelry\.asp$ /index.php?_a=viewCat&catId=1&page=[b]%1[/b] [L] RewriteCond %{QUERY_STRING} [b]!.[/b]
RewriteRule ^jewelry\.asp$ /index.php?_a=viewCat&catId=1&page=[b]0[/b] [L]
#Jewelry
RewriteCond %{QUERY_STRING}>0 ^>(.+)$ [OR]
RewriteCond %{QUERY_STRING}>0 ^pg=1>(.+)$ [OR]
RewriteCond %{QUERY_STRING}>1 ^pg=2>(.+)$ [OR]
RewriteCond %{QUERY_STRING}>2 ^pg=3>(.+)$ [OR]
RewriteCond %{QUERY_STRING}>3 ^pg=4>(.+)$ [OR]
RewriteCond %{QUERY_STRING}>4 ^pg=5>(.+)$ [OR]
RewriteCond %{QUERY_STRING}>5 ^pg=6>(.+)$ [OR]
RewriteCond %{QUERY_STRING}>6 ^pg=7>(.+)$ [OR]
RewriteCond %{QUERY_STRING}>7 ^pg=8>(.+)$ [OR]
RewriteCond %{QUERY_STRING}>8 ^pg=9>(.+)$ [OR]
RewriteCond %{QUERY_STRING}>9 ^pg=10>(.+)$ [OR]
RewriteCond %{QUERY_STRING}>10 ^pg=11>(.+)$ [OR]
...
RewriteCond %{QUERY_STRING}>98 ^pg=99>(.+)$ [OR]
RewriteCond %{QUERY_STRING}>99 ^pg=100>(.+)$
RewriteRule ^jewelry\.asp$ http://www.example.com/index.php?_a=viewCat&catId=1&[b]page=%1[/b] [NC,L]
#Jewelry
RewriteCond %{QUERY_STRING}>0 ^>(0)$ [OR]
RewriteCond %{QUERY_STRING} ^pg=([1-9][0-9]*)$
RewriteRule ^jewelry\.asp$ http://www.example.com/index.php?_a=viewCat&catId=1&page=%1 [NC,L]