Mod_rewrite .htaccess redirect part of a query string?

RewriteCond %{QUERY_STRING} ^\&(.*)$ RewriteRule ^somescript\. Php$ /somescript. Php?

%1 L,R=301.

Thanks for your reply. I tried this, obviously replacing somescipt. Php, but it results in a internal server error?

Any ideas? – Matt Nov 9 '10 at 13:28 Did you enable rewriting (RewriteEngine On)? – elusive Nov 9 '10 at 13:40 Yes, I enabled the rewrite engine.

If you try it you will see it results in an internal sever error. – Matt Nov 9 '10 at 13:45 @Matt: There was a typo in my RewriteCond. Please try the corrected version.

– elusive Nov 9 '10 at 14:02 Thanks for the reply. I tried your re-written suggestion. This time it does not result in a internal server error but unfortunately it doesn't remove the & from the querystring.Do you have any further suggestions?

– Matt Nov 9 '10 at 14:10.

Thanks for your reply. I tried this, but nothing happened. It did not remove the &.

I even tried it on a clean . Htaccess file, but it didn't work. Any ideas?

– Matt Nov 9 '10 at 13:34 oh, maybe you need to escape the? Like: RewriteRule ^(.*)\? &(.*) $1?

$2 L – Simon Nov 9 '10 at 13:38 Thanks but this didn't work either. No change to the querystring. Any other suggestions?

I'm afraid that I only have a very basic knowledge of .htaccess. – Matt Nov 9 '10 at 13:49 the regex seems to work, tested it here: regexplanet. Com/simple/index.

Html Maybe you have a different problem... – Simon Nov 9 '10 at 13:53 Here is the following exact code used in a clean . Htaccess file: RewriteEngine On RewriteRule ^(.*)\? &(.*) $1?

$2 L When uploaded, the URL remains with the & inserted. Confused. – Matt Nov 9 '10 at 13:56.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions


Thank You!
send