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/ 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] 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
Archived
This topic is now archived and is closed to further replies.