In this article we are going to learn how to configure a query string based redirect. One-by-one redirect, mass-redirect - everything about query string based redirects will become clear.
A few weeks ago we changed the layout of the site so we had to make sure users don't get any 404 errors when they try to access the old pages. We had to make sure every page is comfortably redirected to the new version.
We had dynamic urls that needed to be changed to static ones.Since we had "?" in our urls we figured we can not use the classic single page redirect:
because "?" would just be interpreted as the "match optional" regex operator.RewriteRule ^ApplicationsDesc.asp?id=64$ Download-ProgramX [R=301, NC, L]
So we had to try something different. Luckily we found out a "special" server-variable named REQUEST_URI.
First we tried the simplest way we could think of:however we ran into an ugly side effect: the original query is passed through making our new urlRewriteCond %{REQUEST_URI} /ApplicationsDesc.asp
RewriteCond %{QUERY_STRING} id=64
RewriteRule (.*) /Download-ProgramX/ [R=301, NC, L]
Definately not we expected. After a long series of tries we figured out the way to fix this problem: just add an empty "?" at the end of your RewriteRule:/Download-ProgramX/?id=64.
and voila the desired effect is accomplished.RewriteCond %{REQUEST_URI} /ApplicationsDesc.asp
RewriteCond %{QUERY_STRING} id=64
RewriteRule (.*) /Download-ProgramX/? [R=301, NC, L]
RewriteCond %{REQUEST_URI} /ApplicationsDesc.asp
RewriteCond %{QUERY_STRING} id=64$
RewriteRule (.*) /Download-ProgramX/? [R=301, NC, L]
Subscribe now and get all the important articles delivered directly to you.
In this article we will take a look at some of the best pranks made this year and we will list our t
Accessing your Google Plus page on you mobile device is as easy as it gets.
Publishing a post on WordPress.com just became simpler. Users are now able to publish a new post no
During the DICE summit, the 15th annual Interactive Achievements Awards just took place
On April 8th, 2014, Microsoft will be ending the support of Windows XP