mkohan Posted August 25, 2008 Share Posted August 25, 2008 Hi, Is it posssible to write a rule on .htaccess file with RewriteRule, RewriteCond and query_string that redirects this URL http://mydomain.com/&tip=variables&m=data.php to: http://mydomain.com/data.php&tip=variables Thanks, MK Link to comment https://forums.phpfreaks.com/topic/121282-solved-is-it-possible-to-write-a-rule-with-rewritecond-and-query_string/ Share on other sites More sharing options...
corbin Posted August 25, 2008 Share Posted August 25, 2008 RewriteEngine On RewriteRule ^/&tip=([^&]+)&m=(.*?)\.php /$2.php?tip=$1 Should do it. (I rarely get rewrites correct on the first try, so it could be wrong.) Link to comment https://forums.phpfreaks.com/topic/121282-solved-is-it-possible-to-write-a-rule-with-rewritecond-and-query_string/#findComment-625486 Share on other sites More sharing options...
mkohan Posted August 26, 2008 Author Share Posted August 26, 2008 Thank you for your response. after adding RewriteRule the Apache redirects the url to: http://mydomain.com/data.php without the last part &tip=variables . The last part ?tip=$1 does not work properly. Thanks, MK Link to comment https://forums.phpfreaks.com/topic/121282-solved-is-it-possible-to-write-a-rule-with-rewritecond-and-query_string/#findComment-626101 Share on other sites More sharing options...
corbin Posted August 27, 2008 Share Posted August 27, 2008 Ahhh my bad. Try RewriteEngine On RewriteRule ^&tip=([^&]+)&m=(.*?)\.php /$2.php?tip=$1 Link to comment https://forums.phpfreaks.com/topic/121282-solved-is-it-possible-to-write-a-rule-with-rewritecond-and-query_string/#findComment-626607 Share on other sites More sharing options...
mkohan Posted August 27, 2008 Author Share Posted August 27, 2008 Thanks. Mk Link to comment https://forums.phpfreaks.com/topic/121282-solved-is-it-possible-to-write-a-rule-with-rewritecond-and-query_string/#findComment-627034 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.