Redirect Dynamic URLs

#1
I've noticed in my Google Analytics that somehow people are trying to reach some of my articles with a malformed URL. I need to redirect these users to the correct URL. As you can see there's an equal symbol being appended.

Example malformed URL: /content.php?ARTICLEID-ARTICLE-TITLE=
Correct URL: /content.php?ARTICLEID-ARTICLE-TITLE

I tried a simple Apache redirect:
Redirect 302 /content.php?ARTICLEID-ARTICLE-TITLE= /content.php?ARTICLEID-ARTICLE-TITLE

But it doesn't seem to work and it's not dynamic since I don't really know what I'm doing. Can anyone offer some insight or link me to documentation or tutorials that might help?
 

NiteWave

Administrator
#2
this issue is not easy as I though initially.
Redirect 302 /content.php?ARTICLEID-ARTICLE-TITLE= /content.php?ARTICLEID-ARTICLE-TITLE
1. yes, it's not working under litespeed.
2. then I read apache document, can't get a clear answer yet.
3. did tests, not working under apache too.
4. google the net, finally found this one with clear answer
http://www.simonwhatley.co.uk/apache-htaccess-query-string-redirects
However, neither Redirect nor RedirectMatch allow you to specify a query string for the redirect source. In other words, the following statements are invalid and they’ll simply be ignored.
to redirect URL with different query string only, you have to use rewrite rules as described in above page.
 
Top