I've found this topic very helpful in my htaccess research lately. It's been a rough path. I apologize for bringing this topic back from the dead but I have a very similar problem to maniac's and I haven't been able to solve it.
I tried everything that mod_rewrite suggested, especially the part that interested me :
- Code: Select all
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} ^GET\ /mypage\.php.*\ HTTP/ [NC]
RewriteCond %{QUERY_STRING} button\. [NC]
RewriteRule ^mypage\.php$ /mypage.php? [C]
RewriteRule .* /mypage.php?button=1 [R,L]
I got that part to work, but it wasn't exactly what I wanted to do, so I tried to adapt the code so the rest of the URL (including the other query strings) would be preserved.
Basically, I wanted page.php?article=12&sort=desc to redirect to page.php?article=12 .
This might sound easy to do but right now I'm about to lose my mind with this. The architecture of my site is ready for this change but I'm really stuck with this. Any help would be greatly appreciated.