RewriteCond %{query_string} ^(page=[0-9]+?)&from=[0-9]+?$ RewriteRule ^(.*)$ http://www.mysite.com/$1?%1 [R=301,L] Code (markup): Whats wrong with this rewire rule? I basically want to rewrite: somesite.com/node?page=4&from=75 Code (markup): to somesite.com/node?page=4 Code (markup): Thanks for your help.
It can be due to PHPsuEXEC as well. Did you recently updated your Apache without php suexec support to papache with php suexec support?
I was thinking about it, but I haven't done it (too much of a hassle). Could you elaborate a little further though? I am a bit confused why this would have any impact on mod rewrite?
Or maybe mod_rewrite module is just no loaded into Apache. Check your httpd.conf or apache2.conf(as is the case) if the mod_rewrite is loaded and restart apache. For non-debian systems mod_rewrite is Loaded from httpd.conf. For debian systems mod_rewrite needs to be loaded by executing a2endmod rewrite. If it's a windows system it is also loaded form httpd.conf. Regards Andy
Maybe you need to add this line "RewriteEngine on" just above of your RewriteCond line ? To detect the offending line, try removing one by one until the error dissapears. Then try adding that line with a basic syntax, and then step by step until that error appears again.
Thanks for the suggestions, here is a bit more information: Mod rewrite is installed, this is not the only rewrite I have in my .htaccess and all others work just fine. RewriteEngine on is there too, as I said I have multiple rewrites that work beautifully, so that can't be it. I posted the two offending lines, I commented them out and everything works, I put them back and it breaks. I don't want to comment out only one of them, since they depend on each other. Any other suggestions? Does anyone see anything wrong with this?
I have seen query string tests like this cause infinite loops though I am not sure why. Using an alternate approach has fixed it for me: RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /node\?(page=[^&]+)&from=([^\ ]+)\ HTTP/ RewriteRule ^(.*)$ http://www.mysite.com/$1?%1 [R=301,L] Code (markup): See if that works for you.