Skip to main content
edited tags
Link
hakre
  • 199.9k
  • 55
  • 454
  • 865
added 1 characters in body
Source Link
anon
anon

I need some help regarding .htaccess rewrite rule. One of my page have combination of following different values which need to be rewrite in different format.

http://mysite.com/page.phptest TO http://mysite.com/test http://mysite.com/page.php?cat=$cat&id=$id TO   http://mysite.com/test/$cat/$id   TO http://mysite.com/page.php?cat=$cat TO cat=$cat&id=$id http://mysite.com/test/$cat   TO http://mysite.com/page.php?cat=$cat&next=$next TO cat=$cat http://mysite.com/test/$cat/&next=13 TO http://mysite.com/page.php?cat=$cat&next=$next  

I currently have following rule that only works for 2nd and 4th example

RewriteRule ^test/(.+)/(.+)/?$ page.php?cat=$1&id=$2 

I need some help regarding .htaccess rewrite rule. One of my page have combination of following different values which need to be rewrite in different format.

http://mysite.com/page.php TO http://mysite.com/test http://mysite.com/page.php?cat=$cat&id=$id TO http://mysite.com/test/$cat/$id  http://mysite.com/page.php?cat=$cat TO http://mysite.com/test/$cat  http://mysite.com/page.php?cat=$cat&next=$next TO http://mysite.com/test/$cat/&next=13 

I currently have following rule that only works for 2nd and 4th example

RewriteRule ^test/(.+)/(.+)/?$ page.php?cat=$1&id=$2 

I need some help regarding .htaccess rewrite rule. One of my page have combination of following different values which need to be rewrite in different format.

http://mysite.com/test TO http://mysite.com/page.php  http://mysite.com/test/$cat/$id TO http://mysite.com/page.php?cat=$cat&id=$id http://mysite.com/test/$cat TO http://mysite.com/page.php?cat=$cat http://mysite.com/test/$cat/&next=13 TO http://mysite.com/page.php?cat=$cat&next=$next  

I currently have following rule that only works for 2nd and 4th example

RewriteRule ^test/(.+)/(.+)/?$ page.php?cat=$1&id=$2 
Source Link
anon
anon

help with .htaccess rewrite

I need some help regarding .htaccess rewrite rule. One of my page have combination of following different values which need to be rewrite in different format.

http://mysite.com/page.php TO http://mysite.com/test http://mysite.com/page.php?cat=$cat&id=$id TO http://mysite.com/test/$cat/$id http://mysite.com/page.php?cat=$cat TO http://mysite.com/test/$cat http://mysite.com/page.php?cat=$cat&next=$next TO http://mysite.com/test/$cat/&next=13 

I currently have following rule that only works for 2nd and 4th example

RewriteRule ^test/(.+)/(.+)/?$ page.php?cat=$1&id=$2