mga_ka_php Posted April 29, 2010 Share Posted April 29, 2010 Redirect 301 /tank.php?form_id=143&form_name=contact%20us http://www.mydomain.com/forms/contact-us what wrong with that line, it doesn't work. thanks. Quote Link to comment https://forums.phpfreaks.com/topic/200116-whats-wrong-with-this/ Share on other sites More sharing options...
cags Posted April 29, 2010 Share Posted April 29, 2010 Everything after the question mark is the query string, I think the Redirect directive only matches against the REQUEST_URI, if you wish to redirect based on that link you will probably have to use a combination of RewriteCond and RewriteRule. RewriteCond %{QUERY_STRING} form_id=123 RewriteCond %{QUERY_STRING} form_name=contact%20us RewriteRule ^tank.php$ http://www.mydomain.com/forms/contact-us/? [R=301] Quote Link to comment https://forums.phpfreaks.com/topic/200116-whats-wrong-with-this/#findComment-1050357 Share on other sites More sharing options...
mga_ka_php Posted April 30, 2010 Author Share Posted April 30, 2010 does .htaccess have limits in number of lines? because i have tons of link i would like to redirect. Quote Link to comment https://forums.phpfreaks.com/topic/200116-whats-wrong-with-this/#findComment-1050793 Share on other sites More sharing options...
cags Posted April 30, 2010 Share Posted April 30, 2010 Only a theoretical one I suspect, if you really think you have a lot there is probably a flaw in your thinking/design. You should really match patterns for mod_rewrite not exact URLs. The entire process you are doing seems somewhat back to front, which is all to common with people new to mod_rewrite. Quote Link to comment https://forums.phpfreaks.com/topic/200116-whats-wrong-with-this/#findComment-1050921 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.