jayjaz Posted December 17, 2009 Share Posted December 17, 2009 How would you rewrite URL2 to URL1 (give example rewrite rule). a. URL1 http://www.foo.com/index.php?id=1&cat=5&name=foo&test=BAR5 b. URL2 http://www.foo.com/foo/BAR5/1/5/ Quote Link to comment https://forums.phpfreaks.com/topic/185467-how-would-you-rewrite-one-url-to-another/ Share on other sites More sharing options...
rajivgonsalves Posted December 17, 2009 Share Posted December 17, 2009 this should work RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^/]+)/([^/]+)/([^/]+)/(.+)$ index.php?id=$3&cat=$4&name=$1&test=$2 [L] Quote Link to comment https://forums.phpfreaks.com/topic/185467-how-would-you-rewrite-one-url-to-another/#findComment-979199 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.