Hello, I have got a url like this is the first page of url category.php?cat=movie PHP: second page is category.php?cat=movie&page=2&sortby= PHP: if i sort it by date it goes like category.php?cat=movie&page=2&sortby=date PHP: I could not figure it out how to do the rewrite. I managed make one for the first page RewriteRule ^category-(.*)$ category.php?cat=$1 [L,NC] PHP: but i did not know what to do for the other pages. Thank you for your help.
^ Genius reply. That's exactly what he's having problems with. Can you post an example of how you want the rewritten URLs to look like?
1st Page category.php?cat=movie => category-movie.html RewriteRule ^category-(.*)\.html$ category.php?cat=$1 [L,NC] 2nd Page category.php?cat=movie&page=2&sortby= => category-movie-page-2.html RewriteRule ^category-(.*)-page-([0-9]+)\.html$ category.php?cat=$1&page=$2&sortby= [L,NC] 3rd Page category.php?cat=movie&page=2&sortby=date => category-movie-page-2-sortby-date.html RewriteRule ^category-(.*)-page-([0-9]+)-sortby-date\.html$ category.php?cat=$1&page=$2&sortby=date [L,NC]
No luck. it is not working. I am using RewriteRule ^category-(.*)$ category.php?cat=$1 [L,NC] RewriteRule ^category-(.*)-([0-9]+)$ category.php?cat=$1&page=$2 [L,NC] RewriteRule ^category-(.*)-([0-9]+)-(.*)$ category.php?cat=$1&page=$2&sortby=$3 [L,NC] PHP: this is my code "<a href=\"category-".$cat_name."-".$next_page."-".$sortby."\">Next ".$limit." videos »</a>" PHP: any idea why it is not working? this one works for the first page RewriteRule ^category-(.*)$ category.php?cat=$1 [L,NC] PHP:
Ok. sorted. I just changed the order RewriteRule ^category-(.*)-([0-9]+)-(.*)$ category.php?cat=$1&page=$2&sortby=$3 [L,NC] RewriteRule ^category-(.*)-([0-9]+)$ category.php?cat=$1&page=$2 [L,NC] RewriteRule ^category-(.*)$ category.php?cat=$1 [L,NC] PHP: