I am using ColdFusion 10 on a hosted server (hostek.com).
I am trying to write a rewrite rule so that any URL with a BikeID will get redirected to a specific page. I have this as the first rule on the page. The other rules I have are working just fine.
Here is my rule:
RewriteEngine on
RewriteRule ^bikeid* /redirect/redirect.cfm [NC,NS,L]
This rule works for this URL
http://flyingpiston2012-com.securec37.ezhostingserver.com/bikeid=2069
This rule does NOT work for this URL
http://flyingpiston2012-com.securec37.ezhostingserver.com/?bikeid=2069
Other rules that I have tried that do not work are as follows:
RewriteRule ^bikeid* /redirect/redirect.cfm [NC,NS,L]
RewriteRule ^*bikeid* /redirect/redirect.cfm [NC,NS,L]
RewriteRule *bikeid* /redirect/redirect.cfm [NC,NS,L]
RewriteRule \?*bikeid* /redirect/redirect.cfm [NC,NS,L]
RewriteRule ^\?*bikeid* /redirect/redirect.cfm [NC,NS,L]
RewriteRule ^\?bikeid* /redirect/redirect.cfm [NC,NS,L]
What do I have to put in the rule to match any URL that contains the phrase “bikeid”?
My host (hostek.com) FINALLY got back to me and provided me with an answer. I really don’t know how it works, as their explanation was totally lacking. It does work though. They instructed me to add this to the botom of my .htaccess file: